projects
/
vuplus_dvbapp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
61948be
)
if _xmlplus.sax.saxlib is unavailable, just don't generate comments
author
Felix Domke
<tmbinc@elitedvb.net>
Sat, 15 Mar 2008 10:02:32 +0000
(10:02 +0000)
committer
Felix Domke
<tmbinc@elitedvb.net>
Sat, 15 Mar 2008 10:02:32 +0000
(10:02 +0000)
po/xml2po.py
patch
|
blob
|
history
diff --git
a/po/xml2po.py
b/po/xml2po.py
index
3c6219e
..
88e0791
100755
(executable)
--- a/
po/xml2po.py
+++ b/
po/xml2po.py
@@
-4,7
+4,13
@@
import os
import string
from xml.sax import make_parser
from xml.sax.handler import ContentHandler, property_lexical_handler
import string
from xml.sax import make_parser
from xml.sax.handler import ContentHandler, property_lexical_handler
-from _xmlplus.sax.saxlib import LexicalHandler
+try:
+ from _xmlplus.sax.saxlib import LexicalHandler
+ no_comments = False
+except ImportError:
+ class LexicalHandler:
+ pass
+ no_comments = True
class parseXML(ContentHandler, LexicalHandler):
def __init__(self, attrlist):
class parseXML(ContentHandler, LexicalHandler):
def __init__(self, attrlist):
@@
-30,7
+36,8
@@
attrlist = set()
contentHandler = parseXML(attrlist)
parser.setContentHandler(contentHandler)
contentHandler = parseXML(attrlist)
parser.setContentHandler(contentHandler)
-parser.setProperty(property_lexical_handler, contentHandler)
+if not no_comments:
+ parser.setProperty(property_lexical_handler, contentHandler)
dir = os.listdir(sys.argv[1])
for x in dir:
if (str(x[-4:]) == ".xml"):
dir = os.listdir(sys.argv[1])
for x in dir:
if (str(x[-4:]) == ".xml"):