X-Git-Url: http://code.vuplus.com/gitweb/?p=vuplus_dvbapp;a=blobdiff_plain;f=po%2Fxml2po.py;h=bf277987442def52ee7ff1f82e1772d2b134869e;hp=3fef7f82cf617f42595260aae60127070a1dda73;hb=c1311444ea249a45d0eceefa15d77fce410a54da;hpb=69ad8b5035ac9a4043201622eade4264bcc5b2f3 diff --git a/po/xml2po.py b/po/xml2po.py index 3fef7f8..bf27798 100755 --- a/po/xml2po.py +++ b/po/xml2po.py @@ -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