diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-07-01 13:36:20 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-07-01 13:36:20 +0300 |
commit | e4ab4d0239ca5e85055c31cb9f49207ba6950669 (patch) | |
tree | 5943da59f9e2ac197772591c371c3607daef5b17 /testxml/testxml.py | |
parent | abcaf2f3338977659a3a6f489f2bbad0cf98ed23 (diff) | |
download | evol-tools-e4ab4d0239ca5e85055c31cb9f49207ba6950669.tar.gz evol-tools-e4ab4d0239ca5e85055c31cb9f49207ba6950669.tar.bz2 evol-tools-e4ab4d0239ca5e85055c31cb9f49207ba6950669.tar.xz evol-tools-e4ab4d0239ca5e85055c31cb9f49207ba6950669.zip |
testxml: count some missing warnings and error messages in warn/error counter
Diffstat (limited to 'testxml/testxml.py')
-rwxr-xr-x | testxml/testxml.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py index dc737b5..fb7d620 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -172,8 +172,10 @@ def enumDirs(parentDir): checkFilePermission(file2) def checkFilePermission(fullName): + global warnings if os.access(fullName, os.X_OK): print "warn: execute flag on file: " + fullName + warnings = warnings + 1 def loadPaths(): @@ -188,11 +190,13 @@ def loadPaths(): if iconsDir != "graphics/items/": print "warn: itemIcons path has not default value."\ " Will be incampatible with old clients." + warnings = warnings + 1 elif node.attributes["name"].value == "sprites": spritesDir = node.attributes["value"].value if spritesDir != "graphics/sprites/": print "warn: sprites path has not default value."\ " Will be incampatible with old clients." + warnings = warnings + 1 elif node.attributes["name"].value == "sfx": sfxDir = node.attributes["value"].value @@ -201,11 +205,13 @@ def loadPaths(): if particlesDir != "graphics/particles/": print "warn: particles path has not default value."\ " Will be incampatible with old clients." + warnings = warnings + 1 elif node.attributes["name"].value == "maps": mapsDir = node.attributes["value"].value if mapsDir != "maps/": print "warn: maps path has not default value."\ " Will be incampatible with old clients." + warnings = warnings + 1 elif node.attributes["name"].value == "spriteErrorFile": spriteErrorFile = node.attributes["value"].value elif node.attributes["name"].value == "levelUpEffectFile": @@ -989,6 +995,7 @@ def testItems(fileName, imgDir): except Exception as err: print "error: " + fileName + ": corrupted" print err + errors = errors + 1 return idset = set() oldId = None @@ -1208,6 +1215,7 @@ def testItemReplace(id, rootNode, name): except: if len(node.attributes) != 0: print "error: reading replace sprite name, id=" + str(id) + errors = errors + 1 continue checkSpriteName(id, sprite) for itemNode in node.getElementsByTagName("item"): @@ -1228,6 +1236,7 @@ def checkSpriteName(id, name): name != "weapons" and name != "shield" and name != "shields" and \ name != "amulet" and name != "amulets" and name != "ring" and name != "rings": print "error: unknown sprite name " + name + ", id=" + str(id) + errors = errors + 1 def testMonsters(fileName): @@ -1257,6 +1266,7 @@ def testMonsters(fileName): if id in idset: print "error: " + fileName + ": duplicate id=" + id + errors = errors + 1 else: idset.add(id) @@ -1348,6 +1358,7 @@ def testNpcs(file): if id in idset: print "error: " + file + ": duplicate npc id=" + id + errors = errors + 1 else: idset.add(id) |