- if x[-3:] == ".py" and x[:-3] != "__init__":
- #try:
- print "trying to import " + self.prefix + x[:-3]
- exec "import " + self.prefix + x[:-3]
- picturepath = eval(self.prefix + x[:-3]).getPicturePath()
- pluginname = eval(self.prefix + x[:-3]).getPluginName()
- list.append((picturepath, pluginname , x[:-3]))
- #except:
- #print "Failed to open module - wrong plugin!"
+ 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))
+ self.menuUpdate()