+
+ print "Now: " + str(self.currStep)
+
+
+ def ok(self):
+ print "OK"
+ currStep = self.currStep
+
+ if self.showConfig:
+ if (self.wizard[currStep]["config"]["screen"] != None):
+ # TODO: don't die, if no run() is available
+ # there was a try/except here, but i can't see a reason
+ # for this. If there is one, please do a more specific check
+ # and/or a comment in which situation there is no run()
+ if callable(getattr(self.configInstance, "runAsync", None)):
+ self.onShown.remove(self.updateValues)
+ self.configInstance.runAsync(self.finished)
+ return
+ else:
+ self.configInstance.run()
+ self.finished()
+
+ def keyNumberGlobal(self, number):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyNumberGlobal(number)
+
+ def left(self):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyLeft()
+ print "left"
+
+ def right(self):
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyRight()
+ print "right"
+
+ def up(self):
+ if (self.showConfig and self.wizard[self.currStep]["config"]["screen"] != None):
+ self["config"].instance.moveSelection(self["config"].instance.moveUp)
+ elif (self.showList and len(self.wizard[self.currStep]["list"]) > 0):
+ self["list"].instance.moveSelection(self["list"].instance.moveUp)
+ print "up"
+
+ def down(self):
+ if (self.showConfig and self.wizard[self.currStep]["config"]["screen"] != None):
+ self["config"].instance.moveSelection(self["config"].instance.moveDown)
+ elif (self.showList and len(self.wizard[self.currStep]["list"]) > 0):
+ self["list"].instance.moveSelection(self["list"].instance.moveDown)
+ print "down"
+
+ def runCode(self, code):
+ if code != "":
+ print "code", code
+ exec(code)
+
+ def updateValues(self):
+ print "Updating values in step " + str(self.currStep)
+
+ self.stepHistory.append(self.currStep)
+
+ if self.configInstance is not None:
+ del self.configInstance["config"]
+ self.configInstance.doClose()
+ self.configInstance = None
+
+ self.condition = True
+ exec (self.wizard[self.currStep]["condition"])
+ if self.condition:
+ if self.showSteps:
+ self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps))
+ if self.showStepSlider:
+ self["stepslider"].setValue(self.currStep)
+
+ print "wizard text", _(self.wizard[self.currStep]["text"])
+ self["text"].setText(_(self.wizard[self.currStep]["text"]))
+
+ self.runCode(self.wizard[self.currStep]["code"])