git.cweiske.de
/
enigma2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix menu
[enigma2.git]
/
lib
/
python
/
Screens
/
Setup.py
diff --git
a/lib/python/Screens/Setup.py
b/lib/python/Screens/Setup.py
index 41a9cf5136a91eedf6faecfe900a6ca0db77d1f9..0d4764acfb214e0a8a2ad605181665ecf9643348 100644
(file)
--- a/
lib/python/Screens/Setup.py
+++ b/
lib/python/Screens/Setup.py
@@
-23,16
+23,6
@@
except:
setupdom = xml.dom.minidom.parseString(setupfile.read())
setupfile.close()
setupdom = xml.dom.minidom.parseString(setupfile.read())
setupfile.close()
-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 SetupSummary(Screen):
skin = """
<screen position="0,0" size="132,64">
class SetupSummary(Screen):
skin = """
<screen position="0,0" size="132,64">
@@
-78,12
+68,11
@@
class Setup(Screen):
if x.nodeType != xml.dom.minidom.Element.nodeType:
continue
elif x.tagName == 'setup':
if x.nodeType != xml.dom.minidom.Element.nodeType:
continue
elif x.tagName == 'setup':
- ItemText = getValbyAttr(x, "key")
- if ItemText != setup:
+ if x.getAttribute("key") != setup:
continue
self.addItems(list, x.childNodes);
continue
self.addItems(list, x.childNodes);
- myTitle =
getValbyAttr(x, "title
")
-
+ myTitle =
x.getAttribute("title").encode("UTF-8
")
+
#check for list.entries > 0 else self.close
self["config"] = ConfigList(list)
#check for list.entries > 0 else self.close
self["config"] = ConfigList(list)
@@
-136,9
+125,9
@@
class Setup(Screen):
if x.nodeType != xml.dom.minidom.Element.nodeType:
continue
elif x.tagName == 'item':
if x.nodeType != xml.dom.minidom.Element.nodeType:
continue
elif x.tagName == 'item':
-
ItemText = _(getValbyAttr(x, "text")
)
+
item_text = _(x.getAttribute("text").encode("UTF-8") or "??"
)
b = eval(XMLTools.mergeText(x.childNodes));
b = eval(XMLTools.mergeText(x.childNodes));
- print "item " +
ItemT
ext + " " + b.configPath
+ print "item " +
item_t
ext + " " + b.configPath
if b == "":
continue
#add to configlist
if b == "":
continue
#add to configlist
@@
-146,7
+135,7
@@
class Setup(Screen):
# the first b is the item itself, ignored by the configList.
# the second one is converted to string.
# the first b is the item itself, ignored by the configList.
# the second one is converted to string.
- list.append( (
ItemT
ext, item) )
+ list.append( (
item_t
ext, item) )
def handleKey(self, key):
# ignore keys when not enabled
def handleKey(self, key):
# ignore keys when not enabled
@@
-178,3
+167,9
@@
class Setup(Screen):
def keyNumberGlobal(self, number):
self.handleKey(str(number))
def keyNumberGlobal(self, number):
self.handleKey(str(number))
+
+def getSetupTitle(id):
+ xmldata = setupdom.childNodes[0].childNodes
+ for x in elementsWithTag(xmldata, "setup"):
+ if x.getAttribute("key") == id:
+ return x.getAttribute("title").encode("UTF-8")