- text = [_("Hello User.\n\nThis start-wizard will guide you through the basic setup of your Dreambox.\n\nPress the OK button on your remote control to move to the next step."),
- _("You can use the Up and Down buttons on your remote control to select your choice.\n\nWhat do you want to do?"),
- _("Blub")]
-
- listEntries = [[],
- ["Use wizard to set up basic features", "Exit wizard"],
- []]
-
- def __init__(self, session):
- self.skin = WelcomeWizard.skin
- self.numSteps = 3
- self.currStep = 1
-
+ def startElement(self, name, attrs):
+ print name
+ self.currContent = name
+ if (name == "step"):
+ self.lastStep += 1
+ if attrs.has_key('id'):
+ id = str(attrs.get('id'))
+ else:
+ id = ""
+ self.wizard[self.lastStep] = {"id": id, "condition": "", "text": "", "list": [], "config": {"screen": None, "args": None, "type": "" }, "code": "", "codeafter": ""}
+ elif (name == "text"):
+ self.wizard[self.lastStep]["text"] = string.replace(str(attrs.get('value')), "\\n", "\n")
+ elif (name == "listentry"):
+ self.wizard[self.lastStep]["list"].append((str(attrs.get('caption')), str(attrs.get('step'))))
+ elif (name == "config"):
+ exec "from Screens." + str(attrs.get('module')) + " import *"
+ self.wizard[self.lastStep]["config"]["screen"] = eval(str(attrs.get('screen')))
+ if (attrs.has_key('args')):
+ print "has args"
+ self.wizard[self.lastStep]["config"]["args"] = str(attrs.get('args'))
+ self.wizard[self.lastStep]["config"]["type"] = str(attrs.get('type'))
+ elif (name == "code"):
+ if attrs.has_key('pos') and str(attrs.get('pos')) == "after":
+ self.codeafter = True
+ else:
+ self.codeafter = False
+ elif (name == "condition"):
+ pass
+ def endElement(self, name):
+ self.currContent = ""
+ if name == 'code':
+ if self.codeafter:
+ self.wizard[self.lastStep]["codeafter"] = self.wizard[self.lastStep]["codeafter"].strip()
+ else:
+ self.wizard[self.lastStep]["code"] = self.wizard[self.lastStep]["code"].strip()
+ elif name == 'condition':
+ self.wizard[self.lastStep]["condition"] = self.wizard[self.lastStep]["condition"].strip()
+
+ def characters(self, ch):
+ if self.currContent == "code":
+ if self.codeafter:
+ self.wizard[self.lastStep]["codeafter"] = self.wizard[self.lastStep]["codeafter"] + ch
+ else:
+ self.wizard[self.lastStep]["code"] = self.wizard[self.lastStep]["code"] + ch
+ elif self.currContent == "condition":
+ self.wizard[self.lastStep]["condition"] = self.wizard[self.lastStep]["condition"] + ch
+ def __init__(self, session, showSteps = True, showStepSlider = True, showList = True, showConfig = True):