1 from enigma import eConsoleAppContainer
2 from Screens.Screen import Screen
3 from Components.ActionMap import ActionMap, NumberActionMap
4 from Components.ScrollLabel import ScrollLabel
7 #TODO move this to skin.xml
9 <screen position="100,100" size="550,400" title="Command execution..." >
10 <widget name="text" position="0,0" size="550,400" font="Regular;15" />
13 def __init__(self, session, args = None):
14 self.skin = Console.skin
15 Screen.__init__(self, session)
17 self["text"] = ScrollLabel("")
18 self["actions"] = ActionMap(["WizardActions", "DirectionActions"],
22 "up": self["text"].pageUp,
23 "down": self["text"].pageDown
28 self.container = eConsoleAppContainer()
30 self.container.appClosed.get().append(self.runFinished)
31 self.container.dataAvail.get().append(self.dataAvail)
32 self.onLayoutFinish.append(self.startRun) # dont start before gui is finished
35 self["text"].setText(_("Execution Progress:") + "\n\n")
36 self.container.execute(self.cmdlist[self.run])
38 def runFinished(self, retval):
40 if self.run != len(self.cmdlist):
41 self.container.execute(self.cmdlist[self.run])
43 str = self["text"].getText()
44 str += _("Execution finished!!");
45 self["text"].setText(str)
48 if self.run == len(self.cmdlist):
51 def dataAvail(self, str):
52 self["text"].setText(self["text"].getText() + str)