- 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
+ if os.path.exists(path):
+ if fileExists(path + "plugin.py"):
+ 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);
+
+ def getPlugins(self, where):
+ """Get list of plugins in a specific category"""