diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-01-19 20:57:11 +0200 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-01-19 20:57:11 +0200 |
commit | ed9dac12b2097eefb18028f278ce63f8ab6a5004 (patch) | |
tree | 0b4fe915ac541670130ecd6e72eba7f5814135e1 /testxml | |
parent | 2cb241ca6bfb848d31eb208dedd0cfa2bfb851ae (diff) | |
download | evol-tools-ed9dac12b2097eefb18028f278ce63f8ab6a5004.tar.gz evol-tools-ed9dac12b2097eefb18028f278ce63f8ab6a5004.tar.bz2 evol-tools-ed9dac12b2097eefb18028f278ce63f8ab6a5004.tar.xz evol-tools-ed9dac12b2097eefb18028f278ce63f8ab6a5004.zip |
Add auto detection for client data dir.
Diffstat (limited to 'testxml')
-rwxr-xr-x | testxml/testxml.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/testxml/testxml.py b/testxml/testxml.py index ab37bca..99b7b22 100755 --- a/testxml/testxml.py +++ b/testxml/testxml.py @@ -641,8 +641,31 @@ def testMonsters(fileName): testSound(sound.childNodes[0].data) +def haveXml(dir): + if not os.path.isdir(dir) or not os.path.exists(dir): + return False + for file in os.listdir(dir): + if filt.search(file): + return True + return False + + +def detectClientData(dirs): + global parentDir + + for dir in dirs: + if haveXml(dir): + print "Detected client data directory in: " + dir + parentDir = dir + return True + + print "Cant detect client data directory" + exit(1) + showHeader() +print "Detecting clientdata dir" +detectClientData([".", "..", parentDir]) print "Checking xml file syntax" enumDirs(parentDir) loadPaths() |