diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-02-17 21:21:06 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-02-17 21:21:06 +0200 |
commit | fd0c061ec6c5966251d7ec7ff0f508e1fa1d91dc (patch) | |
tree | b2b4b40f8c096031a5cb43156003e655a71dcd6b /testxml | |
parent | 3ce91ef5445ed9ca644257c50ca0467051b8bd54 (diff) | |
download | evol-tools-fd0c061ec6c5966251d7ec7ff0f508e1fa1d91dc.tar.gz evol-tools-fd0c061ec6c5966251d7ec7ff0f508e1fa1d91dc.tar.bz2 evol-tools-fd0c061ec6c5966251d7ec7ff0f508e1fa1d91dc.tar.xz evol-tools-fd0c061ec6c5966251d7ec7ff0f508e1fa1d91dc.zip |
textxml: fix crash if item dont have id.
Diffstat (limited to 'testxml')
-rwxr-xr-x | testxml/testxml.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py index 8345444..80ac29c 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -719,8 +719,21 @@ def testItems(fileName, imgDir): print "Checking items.xml" dom = minidom.parse(parentDir + fileName) idset = set() + oldId = None for node in dom.getElementsByTagName("item"): - id = node.attributes["id"].value + if node.parentNode != dom.documentElement: + continue + + try: + id = node.attributes["id"].value + except: + if oldId is None: + print "error: item without id" + else: + print "error: item without id. Last id was: " + oldId + errors = errors + 1 + continue + oldId = id if id in idset: print "error: duplicated id=" + id errors = errors + 1 |