#TODO move this to skin.xml
skin = """
<screen position="100,100" size="550,400" title="Command execution..." >
#TODO move this to skin.xml
skin = """
<screen position="100,100" size="550,400" title="Command execution..." >
- def __init__(self, session, title = "Console", cmdlist = None, finishedCallback = None):
+ def __init__(self, session, title = "Console", cmdlist = None, finishedCallback = None, closeOnSuccess = False):
self.skin = Console.skin
Screen.__init__(self, session)
self.finishedCallback = finishedCallback
self.skin = Console.skin
Screen.__init__(self, session)
self.finishedCallback = finishedCallback
self["text"] = ScrollLabel("")
self["actions"] = ActionMap(["WizardActions", "DirectionActions"],
self["text"] = ScrollLabel("")
self["actions"] = ActionMap(["WizardActions", "DirectionActions"],
- 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)
def startRun(self):
self["text"].setText(_("Execution Progress:") + "\n\n")
print "Console: executing in run", self.run, " the command:", self.cmdlist[self.run]
def startRun(self):
self["text"].setText(_("Execution Progress:") + "\n\n")
print "Console: executing in run", self.run, " the command:", self.cmdlist[self.run]
def runFinished(self, retval):
self.run += 1
if self.run != len(self.cmdlist):
def runFinished(self, retval):
self.run += 1
if self.run != len(self.cmdlist):
else:
str = self["text"].getText()
str += _("Execution finished!!");
self["text"].setText(str)
if self.finishedCallback is not None:
self.finishedCallback()
else:
str = self["text"].getText()
str += _("Execution finished!!");
self["text"].setText(str)
if self.finishedCallback is not None:
self.finishedCallback()
def dataAvail(self, str):
self["text"].setText(self["text"].getText() + str)
def dataAvail(self, str):
self["text"].setText(self["text"].getText() + str)