summaryrefslogtreecommitdiff
path: root/testxml/testxml.py
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-06-11 14:37:05 +0300
committerAndrei Karas <akaras@inbox.ru>2012-06-11 14:37:05 +0300
commit64e65af6ac803afdc038d5bc64754186f09f7686 (patch)
treec11887c52f3146040f585d3cb02302f2bebcc128 /testxml/testxml.py
parent4d992247afa0895b6dafb357ae28ead68f359d88 (diff)
downloadtools-64e65af6ac803afdc038d5bc64754186f09f7686.tar.gz
tools-64e65af6ac803afdc038d5bc64754186f09f7686.tar.bz2
tools-64e65af6ac803afdc038d5bc64754186f09f7686.tar.xz
tools-64e65af6ac803afdc038d5bc64754186f09f7686.zip
testxml: add check for executable files.
Diffstat (limited to 'testxml/testxml.py')
-rwxr-xr-xtestxml/testxml.py20
1 files changed, 14 insertions, 6 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py
index 7f67c17..cd1f58c 100755
--- a/testxml/testxml.py
+++ b/testxml/testxml.py
@@ -147,12 +147,20 @@ def enumDirs(parentDir):
file2 = os.path.abspath(parentDir + os.path.sep + file1)
if not os.path.isfile(file2):
enumDirs(file2)
- elif filt.search(file1):
- try:
- minidom.parse(file2)
- except xml.parsers.expat.ExpatError as err:
- print "error: " + file2 + ", line=" + str(err.lineno) + ", char=" + str(err.offset)
- errors = errors + 1
+ else:
+ if filt.search(file1):
+ try:
+ minidom.parse(file2)
+ except xml.parsers.expat.ExpatError as err:
+ print "error: " + file2 + ", line=" + str(err.lineno) + ", char=" + str(err.offset)
+ errors = errors + 1
+ if file1 != "testxml.py":
+ checkFilePermission(file2)
+
+def checkFilePermission(fullName):
+ if os.access(fullName, os.X_OK):
+ print "warn: execute flag on file: " + fullName
+
def loadPaths():
global warnings, iconsDir, spritesDir, sfxDir, particlesDir, mapsDir, attackSfxFile, spriteErrorFile, \