summaryrefslogtreecommitdiff
path: root/tools/map-db.py
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-03-07 12:41:48 -0800
committerBen Longbons <b.r.longbons@gmail.com>2014-03-07 12:41:54 -0800
commit0ad0110f8e7f90452c2229fe0031ce68b7b3d1e4 (patch)
treed6c118cb5578652a48de3e0efaf9d4b02fc62a72 /tools/map-db.py
parent300be2981298f9939d06f8fdc45a254ea87f6506 (diff)
downloadclientdata-0ad0110f8e7f90452c2229fe0031ce68b7b3d1e4.tar.gz
clientdata-0ad0110f8e7f90452c2229fe0031ce68b7b3d1e4.tar.bz2
clientdata-0ad0110f8e7f90452c2229fe0031ce68b7b3d1e4.tar.xz
clientdata-0ad0110f8e7f90452c2229fe0031ce68b7b3d1e4.zip
Replace tools dir with symlink to the canonical tools repo
This could have been done a while ago, but was delayed in case someone updated their client-data without updating thier server-data.
Diffstat (limited to 'tools/map-db.py')
-rwxr-xr-xtools/map-db.py59
1 files changed, 0 insertions, 59 deletions
diff --git a/tools/map-db.py b/tools/map-db.py
deleted file mode 100755
index 5215e72d..00000000
--- a/tools/map-db.py
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/usr/bin/env python
-#-*- coding:utf-8 -*-
-
-import sys
-import os
-import subprocess
-import tempfile
-import re
-
-CLIENT_DATA_ROOT = os.path.realpath(
- os.path.join(
- os.path.dirname(__file__),
- u'..',
- )
-)
-
-MAP_RE = re.compile(r'^(\d{3})-(\d{1})$')
-
-def list_missing_minimaps(maps, minimaps):
- def minimap_wanted(m):
- match = MAP_RE.match(m)
- if match:
- d = match.group(2)
- # We ignore indoor maps
- if not d == '2':
- return True
- return False
-
- missing_minimaps = set([m for m in maps if minimap_wanted(m)]) - set(minimaps)
- retcode = len(missing_minimaps)
- print '\n'.join(sorted(missing_minimaps))
- return retcode
-
-def usage():
- sys.stderr.write(u'''Usage: %(prgm_name)s CMD
-
- Where CMD is one of:
- list-missing-minimaps, lm: Lists all maps which do not
- have a minimap.
-
- \n''' % {'prgm_name': sys.argv[0]})
-
-def main():
- if not len(sys.argv) > 1:
- usage()
- return 127
- action = sys.argv[1].lower()
- maps = [os.path.splitext(p)[0] for p in os.listdir(os.path.join(CLIENT_DATA_ROOT, u'maps'))]
- minimaps = [os.path.splitext(p)[0] for p in os.listdir(os.path.join(CLIENT_DATA_ROOT, u'graphics', u'minimaps'))]
- status = 0
- if action in ('list-missing-minimaps', 'lm'):
- status = list_missing_minimaps(maps, minimaps)
- else:
- usage()
- return 127
- return status
-
-if __name__ == '__main__':
- sys.exit(main())