3 from Tools.Directories import *
9 self.setPluginPrefix("Plugins.")
11 def setPluginPrefix(self, prefix):
14 def getPluginList(self):
16 dir = os.listdir("/usr/lib/enigma2/python/Plugins/")
18 if x[-3:] == ".py" and x[:-3] != "__init__":
20 print "trying to import " + self.prefix + x[:-3]
21 exec "import " + self.prefix + x[:-3]
22 picturepath = eval(self.prefix + x[:-3]).getPicturePath()
23 pluginname = eval(self.prefix + x[:-3]).getPluginName()
24 list.append((picturepath, pluginname , x[:-3]))
26 #print "Failed to open module - wrong plugin!"
29 def runPlugin(self, plugin, session):
31 exec "import " + self.prefix + plugin[2]
32 eval(self.prefix + plugin[2]).main(session)
34 print "exec of plugin failed!"
36 plugins = PluginComponent()