From 17fd99306e089ff4e0df415ce0bb62e012dcbbb8 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 9 Jul 2016 03:33:04 +0300 Subject: testxml: check map names in tmx files. --- testxml/testxml.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'testxml') 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"): -- cgit v1.2.3-70-g09d2