summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-07-09 03:33:04 +0300
committerAndrei Karas <akaras@inbox.ru>2016-07-09 03:33:04 +0300
commit17fd99306e089ff4e0df415ce0bb62e012dcbbb8 (patch)
tree41f9a184eb0e465c36fd04ed152b0290f469deea
parentd2075333b5ba2a858aa82ecda2f9b8820dd9a602 (diff)
downloadevol-tools-17fd99306e089ff4e0df415ce0bb62e012dcbbb8.tar.gz
evol-tools-17fd99306e089ff4e0df415ce0bb62e012dcbbb8.tar.bz2
evol-tools-17fd99306e089ff4e0df415ce0bb62e012dcbbb8.tar.xz
evol-tools-17fd99306e089ff4e0df415ce0bb62e012dcbbb8.zip
testxml: check map names in tmx files.s20160709release2016-07-09
-rwxr-xr-xtestxml/testxml.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index 497d9f5..c350e65 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -1403,6 +1403,27 @@ def testMap(mapName, file, path):
if silent == False or file.find("maps/test") != 0:
showMsgFile(file, "map height to small: " + str(mapHeight), False)
+ if len(dom.getElementsByTagName("properties")) < 1:
+ showMsgFile(file, "missing map properties", True)
+ return
+
+ for props in dom.getElementsByTagName("properties"):
+ for prop in props.getElementsByTagName("property"):
+ try:
+ name = prop.attributes["name"].value
+ except:
+ name = ""
+ if name == "":
+ showMsgFile(file, "wrong property", True)
+ continue
+ try:
+ value = prop.attributes["value"].value
+ except:
+ value = ""
+ if value == "" and name == "name":
+ showMsgFile(file, "empty map name property", True)
+ continue
+
tilesMap = dict()
for tileset0 in dom.getElementsByTagName("tileset"):