diff options
| author | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-08-16 03:25:52 +0000 |
|---|---|---|
| committer | Ronny Strutz <ronny.strutz@multimedia-labs.de> | 2005-08-16 03:25:52 +0000 |
| commit | 5db1b523e89c6abca92c70916ef7a63b6d51b7e3 (patch) | |
| tree | 7953a4e0cacc8ed13e3116867568bc406db03e42 /lib/python | |
| parent | a6f385788cf6331d35b5cd2350eb8144e81567fb (diff) | |
| download | enigma2-5db1b523e89c6abca92c70916ef7a63b6d51b7e3.tar.gz enigma2-5db1b523e89c6abca92c70916ef7a63b6d51b7e3.zip | |
add xml stuff
Diffstat (limited to 'lib/python')
| -rw-r--r-- | lib/python/Screens/Setup.py | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/lib/python/Screens/Setup.py b/lib/python/Screens/Setup.py index 6630923e..582314d5 100644 --- a/lib/python/Screens/Setup.py +++ b/lib/python/Screens/Setup.py @@ -1,15 +1,62 @@ from Screen import Screen from Components.ActionMap import ActionMap + +import xml.dom.minidom +from xml.dom import EMPTY_NAMESPACE +from skin import elementsWithTag + +from Tools import XMLTools + +setupdom = xml.dom.minidom.parseString( + """ + <setup key="rc" title="RC Menu"> + <item text="Repeat Rate">config.inputDevices.repeat</item> + <item text="Delay Rate">config.inputDevices.delay</item> + </setup> + """) + +def getValbyAttr(x, attr): + for p in range(x.attributes.length): + a = x.attributes.item(p) + attrib = str(a.name) + value = str(a.value) + if attrib == attr: + return value + return "" + class Setup(Screen): + + def createDialog(self, childNode): + print "createDialog" + for x in childNode: + if x.nodeType != xml.dom.minidom.Element.nodeType: + continue + elif x.tagName == 'item': + ItemText = getValbyAttr(x, "text") + b = XMLTools.mergeText(x.childNodes); + print "item " + ItemText + " " + b + #add to configlist + def __init__(self, session, setup): Screen.__init__(self, session) print "request setup for " + setup + + entries = setupdom.childNodes + + for x in entries: #walk through the actual nodelist + if x.nodeType != xml.dom.minidom.Element.nodeType: + continue + elif x.tagName == 'setup': + ItemText = getValbyAttr(x, "key") + if ItemText != setup: + continue + self.createDialog(x.childNodes); + self["actions"] = ActionMap(["OkCancelActions"], { #"ok": self.inc, "cancel": self.close }) - |
