1 # must be fixed for the new plugin interface
2 from Tools.BoundFunction import boundFunction
3 from Tools.Directories import pathExists
4 from Plugins.Plugin import PluginDescriptor
5 from pluginrunner import PluginRunner
9 TUXBOX_PLUGINS_PATH = "/usr/lib/tuxbox/plugins/"
14 if pathExists(TUXBOX_PLUGINS_PATH):
15 dir = listdir(TUXBOX_PLUGINS_PATH)
19 params = getPluginParams(x)
20 pluginlist.append(PluginDescriptor(name=params["name"], description=params["desc"], where = PluginDescriptor.WHERE_PLUGINMENU, icon="tuxbox.png", fnc=boundFunction(main, plugin=x)))
24 def getPluginParams(file):
27 file = open(TUXBOX_PLUGINS_PATH + file, "r")
28 for x in file.readlines():
30 params[split[0]] = split[1]
33 print "no tuxbox plugins found"
37 def main(session, plugin, **kwargs):
38 print "Running plugin " + plugin[:-4] + ".so with config file", plugin
39 print getPluginParams(plugin)
40 session.open(PluginRunner, plugin[:-4].split(".so")[0])
42 def Plugins(**kwargs):