+
+ 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):
+ self.resetCounter()
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyLeft()
+ print "left"
+
+ def right(self):
+ self.resetCounter()
+ if (self.wizard[self.currStep]["config"]["screen"] != None):
+ self.configInstance.keyRight()
+ print "right"
+
+ def up(self):
+ self.resetCounter()
+ 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]["evaluatedlist"]) > 0):
+ self["list"].instance.moveSelection(self["list"].instance.moveUp)
+ if self.wizard[self.currStep].has_key("onselect"):
+ self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1]
+ exec("self." + self.wizard[self.currStep]["onselect"] + "()")
+ print "up"
+
+ def down(self):
+ self.resetCounter()
+ 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]["evaluatedlist"]) > 0):
+ #self["list"].instance.moveSelection(self["list"].instance.moveDown)
+ if self["list"].index + 1 >= self["list"].count():
+ self["list"].index = 0
+ else:
+ self["list"].index += 1
+ if self.wizard[self.currStep].has_key("onselect"):
+ print "current:", self["list"].current
+ #self.selection = self.wizard[self.currStep]["evaluatedlist"][self["list"].l.getCurrentSelectionIndex()][1]
+ #exec("self." + self.wizard[self.currStep]["onselect"] + "()")
+ print "down"
+
+ def selChanged(self):
+ self.resetCounter()
+
+ 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]["evaluatedlist"]) > 0):
+ if self.wizard[self.currStep].has_key("onselect"):
+ self.selection = self["list"].current[1]
+ print "self.selection:", self.selection
+ exec("self." + self.wizard[self.currStep]["onselect"] + "()")
+
+ def resetCounter(self):
+ self.timeoutCounter = self.wizard[self.currStep]["timeout"]
+
+ def runCode(self, code):
+ if code != "":
+ print "code", code
+ exec(code)
+
+ def updateText(self, firstset = False):
+ text = _(self.wizard[self.currStep]["text"])
+ if text.find("[timeout]") != -1:
+ text = text.replace("[timeout]", str(self.timeoutCounter))
+ self["text"].setText(text)
+ else:
+ if firstset:
+ self["text"].setText(text)
+
+ def updateValues(self):
+ print "Updating values in step " + str(self.currStep)
+ self.timeoutTimer.stop()
+
+ 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:
+ print "wizard step:", self.wizard[self.currStep]
+
+ if self.showSteps:
+ self["step"].setText(_("Step ") + str(self.currStep) + "/" + str(self.numSteps))
+ if self.showStepSlider:
+ self["stepslider"].setValue(self.currStep)
+
+ if self.wizard[self.currStep]["timeout"] is not None:
+ self.resetCounter()
+ self.timeoutTimer.start(1000)