add some debugging to the Wizard
authorStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 19 Feb 2008 13:23:10 +0000 (13:23 +0000)
committerStefan Pluecken <stefan.pluecken@multimedia-labs.de>
Tue, 19 Feb 2008 13:23:10 +0000 (13:23 +0000)
catch a stepHistory situation

lib/python/Screens/Wizard.py

index c987ac6..f018c3c 100644 (file)
@@ -211,12 +211,17 @@ class Wizard(Screen, HelpableScreen):
                self.lcdCallbacks.append(callback)
 
        def back(self):
                self.lcdCallbacks.append(callback)
 
        def back(self):
+               print "getting back..."
+               print "stepHistory:", self.stepHistory
                if len(self.stepHistory) > 1:
                        self.currStep = self.stepHistory[-2]
                        self.stepHistory = self.stepHistory[:-2]
                if self.currStep < 1:
                        self.currStep = 1
                if len(self.stepHistory) > 1:
                        self.currStep = self.stepHistory[-2]
                        self.stepHistory = self.stepHistory[:-2]
                if self.currStep < 1:
                        self.currStep = 1
+               print "currStep:", self.currStep
+               print "new stepHistory:", self.stepHistory
                self.updateValues()
                self.updateValues()
+               print "after updateValues stepHistory:", self.stepHistory
                
        def markDone(self):
                pass
                
        def markDone(self):
                pass
@@ -366,7 +371,8 @@ class Wizard(Screen, HelpableScreen):
                self.condition = True
                exec (self.wizard[self.currStep]["condition"])
                if self.condition:
                self.condition = True
                exec (self.wizard[self.currStep]["condition"])
                if self.condition:
-                       self.stepHistory.append(self.currStep)
+                       if len(self.stepHistory) == 0 or self.stepHistory[-1] != self.currStep:
+                               self.stepHistory.append(self.currStep)
                        print "wizard step:", self.wizard[self.currStep]
                        
                        if self.showSteps:
                        print "wizard step:", self.wizard[self.currStep]
                        
                        if self.showSteps: