X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=lib%2Fpython%2FScreens%2FConsole.py;h=2058c041f887ea11951bba5570af639483981bc3;hp=b8f74125b51ae5e606dbb7b10a986151c86ebea0;hb=1a2a0e2f94f8f9ba64b1e2d11b42bec88ed612d0;hpb=d130f81ed02482d5b43cb7da2399a6bc4414af41 diff --git a/lib/python/Screens/Console.py b/lib/python/Screens/Console.py index b8f7412..2058c04 100644 --- a/lib/python/Screens/Console.py +++ b/lib/python/Screens/Console.py @@ -7,11 +7,10 @@ class Console(Screen): #TODO move this to skin.xml skin = """ - + """ def __init__(self, session, title = "Console", cmdlist = None, finishedCallback = None, closeOnSuccess = False): - self.skin = Console.skin Screen.__init__(self, session) self.finishedCallback = finishedCallback @@ -33,8 +32,8 @@ class Console(Screen): self.container = eConsoleAppContainer() self.run = 0 - self.container.appClosed.get().append(self.runFinished) - self.container.dataAvail.get().append(self.dataAvail) + self.container.appClosed.append(self.runFinished) + self.container.dataAvail.append(self.dataAvail) self.onLayoutFinish.append(self.startRun) # dont start before gui is finished def updateTitle(self): @@ -43,16 +42,19 @@ class Console(Screen): def startRun(self): self["text"].setText(_("Execution Progress:") + "\n\n") print "Console: executing in run", self.run, " the command:", self.cmdlist[self.run] - self.container.execute(self.cmdlist[self.run]) + if self.container.execute(self.cmdlist[self.run]): #start of container application failed... + self.runFinished(-1) # so we must call runFinished manual def runFinished(self, retval): self.run += 1 if self.run != len(self.cmdlist): - self.container.execute(self.cmdlist[self.run]) + if self.container.execute(self.cmdlist[self.run]): #start of container application failed... + self.runFinished(-1) # so we must call runFinished manual else: str = self["text"].getText() str += _("Execution finished!!"); self["text"].setText(str) + self["text"].lastPage() if self.finishedCallback is not None: self.finishedCallback() if not retval and self.closeOnSuccess: @@ -61,6 +63,8 @@ class Console(Screen): def cancel(self): if self.run == len(self.cmdlist): self.close() + self.container.appClosed.remove(self.runFinished) + self.container.dataAvail.remove(self.dataAvail) def dataAvail(self, str): self["text"].setText(self["text"].getText() + str)