- 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))
- self.menuUpdate()
- return list
-
- def menuDelete(self):
- for menuEntry in self.menuEntries:
- menuupdater.delMenuItem(menuEntry[0][0], menuEntry[0][2], menuEntry[1], menuEntry[0][3])
+ plugin = my_import('.'.join(("Plugins", x, "plugin")))
+
+ if not plugin.__dict__.has_key("Plugins"):
+ print "Plugin %s doesn't have 'Plugin'-call." % (x)
+ continue
+
+ print "plugin", plugin
+ plugins = plugin.Plugins()
+
+ # allow single entry not to be a list
+ if type(plugins) is not list:
+ plugins = [ plugins ]
+
+ for p in plugins:
+ self.addPlugin(p);