+ self.session.openWithCallback(self.exitWizardQuestion, MessageBox, (_("Are you sure you want to exit this wizard?") ) )
+ if self.currStep < 1:
+ self.currStep = 1
+ print "currStep:", self.currStep
+ print "new stepHistory:", self.stepHistory
+ self.updateValues()
+ print "after updateValues stepHistory:", self.stepHistory
+
+ def exitWizardQuestion(self, ret = False):
+ if (ret):
+ self.markDone()
+ self.close()
+
+ def markDone(self):
+ pass
+
+ def getStepWithID(self, id):
+ print "getStepWithID:", id
+ count = 0
+ for x in self.wizard.keys():
+ if self.wizard[x]["id"] == id:
+ print "result:", count
+ return count
+ count += 1
+ print "result: nothing"
+ return 0
+
+ def finished(self, gotoStep = None, *args, **kwargs):
+ print "finished"
+ currStep = self.currStep
+
+ if self.updateValues not in self.onShown:
+ self.onShown.append(self.updateValues)
+
+ if self.showConfig:
+ if self.wizard[currStep]["config"]["type"] == "dynamic":
+ eval("self." + self.wizard[currStep]["config"]["evaluation"])()
+
+ if self.showList:
+ if (len(self.wizard[currStep]["evaluatedlist"]) > 0):
+ print "current:", self["list"].current
+ nextStep = self["list"].current[1]
+ if (self.wizard[currStep].has_key("listevaluation")):
+ exec("self." + self.wizard[self.currStep]["listevaluation"] + "('" + nextStep + "')")
+ else:
+ self.currStep = self.getStepWithID(nextStep)
+
+ print_now = True
+ if ((currStep == self.numSteps and self.wizard[currStep]["nextstep"] is None) or self.wizard[currStep]["id"] == "end"): # wizard finished
+ print "wizard finished"
+ self.markDone()
+ self.close()
+ else:
+ self.codeafter = True
+ self.runCode(self.wizard[currStep]["codeafter"])
+ self.prevStep = currStep
+ self.gotoStep = gotoStep
+ if not self.runCode(self.wizard[currStep]["codeafter_async"]):
+ self.afterAsyncCode()
+ else:
+ if self.updateValues in self.onShown:
+ self.onShown.remove(self.updateValues)
+
+ if print_now:
+ print "Now: " + str(self.currStep)
+
+ def ok(self):
+ print "OK"
+ if self.disableKeys:
+ return
+ 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)):
+ if self.updateValues in self.onShown:
+ self.onShown.remove(self.updateValues)
+ self.configInstance.runAsync(self.finished)
+ return
+ else:
+ self.configInstance.run()
+ self.finished()