quickfix for usals-settings (don't want to break configSequence right now :)
[enigma2.git] / po / xml2po.py
index 3fef7f82cf617f42595260aae60127070a1dda73..bf277987442def52ee7ff1f82e1772d2b134869e 100755 (executable)
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 import sys
+import os
 from xml.sax import make_parser
 from xml.sax.handler import ContentHandler
 
@@ -11,15 +12,26 @@ class parseXML(ContentHandler):
        def startElement(self, name, attrs):
                if (attrs.has_key('text')):
                        attrlist[attrs.get('text', "")] = "foo"
-
-sys.argv[1]
+               if (attrs.has_key('title')):
+                       attrlist[attrs.get('title', "")] = "foo"
+               if (attrs.has_key('value')):
+                       attrlist[attrs.get('value', "")] = "foo"
+               if (attrs.has_key('caption')):
+                       attrlist[attrs.get('caption', "")] = "foo"
 
 parser = make_parser()
 
 attrlist = {}          
+
 contentHandler = parseXML(attrlist)
 parser.setContentHandler(contentHandler)
-parser.parse(sys.argv[1])
+
+dir = os.listdir(sys.argv[1])
+for x in dir:
+       if (str(x[-4:]) == ".xml"):
+               parser.parse(sys.argv[1] + str(x))
+
+#parser.parse(sys.argv[1])
 
 for k, v in attrlist.items():
        print