add missing __init__.py
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 10 Jan 2006 15:54:22 +0000 (15:54 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 10 Jan 2006 15:54:22 +0000 (15:54 +0000)
add a try/except block around the plugin loading for faulty plugins

lib/python/Components/PluginComponent.py
lib/python/Plugins/update/__init__.py [new file with mode: 0644]

index 0b40702..67373ea 100644 (file)
@@ -20,21 +20,24 @@ class PluginComponent:
 
                for x in dir:
                        path = resolveFilename(SCOPE_PLUGINS, x) + "/"
 
                for x in dir:
                        path = resolveFilename(SCOPE_PLUGINS, x) + "/"
-                       if os.path.exists(path):
-                               if fileExists(path + "plugin.py"):
-                                       pluginmodule = self.prefix + x + ".plugin"
-                                       print "trying to import " + pluginmodule
-                                       exec "import " + pluginmodule
-                                       plugin = eval(pluginmodule)
-                                       picturepath = plugin.getPicturePath()
-                                       pluginname = plugin.getPluginName()
-                                       try:
-                                               for menuEntry in plugin.getMenuRegistrationList():
-                                                       self.menuEntries.append([menuEntry, pluginmodule])
-                                       except:
-                                               pass
-       
-                                       list.append((picturepath, pluginname , x))
+                       try:
+                               if os.path.exists(path):
+                                       if fileExists(path + "plugin.py"):
+                                               pluginmodule = self.prefix + x + ".plugin"
+                                               print "trying to import " + pluginmodule
+                                               exec "import " + pluginmodule
+                                               plugin = eval(pluginmodule)
+                                               picturepath = plugin.getPicturePath()
+                                               pluginname = plugin.getPluginName()
+                                               try:
+                                                       for menuEntry in plugin.getMenuRegistrationList():
+                                                               self.menuEntries.append([menuEntry, pluginmodule])
+                                               except:
+                                                       pass
+               
+                                               list.append((picturepath, pluginname , x))
+                       except:
+                               print "Directory", path, "contains a faulty plugin"
                self.menuUpdate()
                return list
        
                self.menuUpdate()
                return list
        
diff --git a/lib/python/Plugins/update/__init__.py b/lib/python/Plugins/update/__init__.py
new file mode 100644 (file)
index 0000000..e69de29