1 from enigma import eDBoxLCD, eRCInput, fbClass, eConsoleAppContainer
2 from Screens.Screen import Screen
3 from Screens.MessageBox import MessageBox
5 class PluginRunner(Screen):
7 <screen position="1,1" size="1,1" title="Plugin" >
9 def __init__(self, session, pluginname, args = None):
10 self.skin = PluginRunner.skin
11 Screen.__init__(self, session)
12 self.container = eConsoleAppContainer()
13 self.container.appClosed.append(self.finishedExecution)
14 self.runPlugin(pluginname)
16 def runPlugin(self, pluginname):
17 eDBoxLCD.getInstance().lock()
18 eRCInput.getInstance().lock()
19 fbClass.getInstance().lock()
20 print "executing:", ("pluginlauncher -x %s" % pluginname)
21 if self.container.execute("pluginlauncher -x %s" % pluginname):
22 self.finishedExecution(None)
24 def finishedExecution(self, retval = 1):
25 print "PluginRunner retval:", retval
26 fbClass.getInstance().unlock()
27 eRCInput.getInstance().unlock()
28 eDBoxLCD.getInstance().unlock()
30 if retval is None or retval != 1:
31 self.session.openWithCallback(
32 self.finishedExecution,
34 _("Error executing plugin") % (param)