1 # must be fixed for the new plugin interface
3 from Screens.Screen import Screen
4 from Screens.MessageBox import MessageBox
5 from Components.ActionMap import ActionMap
6 from Components.Label import Label
7 from Tools.BoundFunction import boundFunction
8 from Tools.Directories import pathExists
9 from Plugins.Plugin import PluginDescriptor
13 TUXBOX_PLUGINS_PATH = "/usr/lib/tuxbox/plugins/"
18 if pathExists(TUXBOX_PLUGINS_PATH):
19 dir = os.listdir(TUXBOX_PLUGINS_PATH)
23 params = getPluginParams(x)
24 pluginlist.append(PluginDescriptor(name=params["name"], description=params["desc"], where = PluginDescriptor.WHERE_PLUGINMENU, icon="tuxbox.png", fnc=boundFunction(main, plugin=x)))
28 def getPluginParams(file):
31 file = open(TUXBOX_PLUGINS_PATH + file, "r")
32 for x in file.readlines():
34 params[split[0]] = split[1]
37 print "no tuxbox plugins found"
41 def main(session, plugin):
42 print "Running plugin " + plugin[:-4] + ".so with config file", plugin
43 print getPluginParams(plugin)