aboutsummaryrefslogtreecommitdiff
path: root/lib/python/Tools/XMLTools.py
diff options
context:
space:
mode:
authorFelix Domke <tmbinc@elitedvb.net>2005-05-14 15:23:23 +0000
committerFelix Domke <tmbinc@elitedvb.net>2005-05-14 15:23:23 +0000
commit7bc4a59528ab13f3062dc1520e76f9ecedd87400 (patch)
tree9d6e91be12147eee77d82ec5b49c24ae44f85bd3 /lib/python/Tools/XMLTools.py
parentab8d418f82b2835c267d88ded5d748a6f0e8a852 (diff)
downloadenigma2-7bc4a59528ab13f3062dc1520e76f9ecedd87400.tar.gz
enigma2-7bc4a59528ab13f3062dc1520e76f9ecedd87400.zip
- work on timers
- add eInput widget - add python/Tools - add flexible listbox content
Diffstat (limited to 'lib/python/Tools/XMLTools.py')
-rw-r--r--lib/python/Tools/XMLTools.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/python/Tools/XMLTools.py b/lib/python/Tools/XMLTools.py
new file mode 100644
index 00000000..aaab4677
--- /dev/null
+++ b/lib/python/Tools/XMLTools.py
@@ -0,0 +1,17 @@
+import xml.dom.minidom
+
+def elementsWithTag(el, tag):
+
+ """filters all elements of childNode with the specified function
+ example: nodes = elementsWithTag(childNodes, lambda x: x == "bla")"""
+
+ # fiiixme! (works but isn't nice)
+ if isinstance(tag, str):
+ s = tag
+ tag = lambda x: x == s
+
+ for x in el:
+ if x.nodeType != xml.dom.minidom.Element.nodeType:
+ continue
+ if tag(x.tagName):
+ yield x