add some translations (translations in the wizard don't work in some places)
[vuplus_dvbapp] / po / xml2po.py
index 3fef7f8..bf27798 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