summaryrefslogtreecommitdiff
path: root/utils/nwztools/database/gen_db.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils/nwztools/database/gen_db.py')
-rwxr-xr-xutils/nwztools/database/gen_db.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/nwztools/database/gen_db.py b/utils/nwztools/database/gen_db.py
index 23f4e3f474..9e8bc89102 100755
--- a/utils/nwztools/database/gen_db.py
+++ b/utils/nwztools/database/gen_db.py
@@ -46,12 +46,12 @@ with open('series.txt') as fp:
46g_hash_nvp = dict() # hash -> nvp 46g_hash_nvp = dict() # hash -> nvp
47g_nvp_hash = dict() # codename -> hash 47g_nvp_hash = dict() # codename -> hash
48HASH_SIZE=6 48HASH_SIZE=6
49map_files = glob.glob('nvp/nw*.txt') 49map_files = glob.glob('nvp/nw*.txt') + glob.glob('nvp/dmp*.txt')
50for f in map_files: 50for f in map_files:
51 h = hashlib.md5() 51 h = hashlib.md5()
52 h.update(open(f, "rb").read()) 52 h.update(open(f, "rb").read())
53 hash = h.hexdigest() 53 hash = h.hexdigest()
54 codename = re.search('(nw.*)\.txt', f).group(1) 54 codename = re.search('nvp/([^\.]*)\.txt', f).group(1)
55 # sanity check 55 # sanity check
56 if not (codename in g_series_codename): 56 if not (codename in g_series_codename):
57 print("Warning: file %s does not have a match series in series.txt" % f) 57 print("Warning: file %s does not have a match series in series.txt" % f)