Fix to have gen_db.py also include files that accidentally have uppercase file extensions, affecting ~200 files previously skipped.

pull/515/head
Alexander Gessler 2015-03-28 13:36:47 +01:00 committed by Alexander Gessler
parent 0943936b31
commit d717c4b2dd
2 changed files with 3 additions and 5 deletions

View File

@ -164,7 +164,7 @@ def gen_db(ext_list,outfile):
num = 0 num = 0
for tp in settings.model_directories: for tp in settings.model_directories:
num += process_dir(tp, outfile, num += process_dir(tp, outfile,
lambda x: os.path.splitext(x)[1] in ext_list and not x in settings.files_to_ignore) lambda x: os.path.splitext(x)[1].lower() in ext_list and not x in settings.files_to_ignore)
print("="*60) print("="*60)
print("Updated {0} entries".format(num)) print("Updated {0} entries".format(num))

View File

@ -50,15 +50,13 @@ def hashing(file,pp):
needs to be persistent across different python implementations needs to be persistent across different python implementations
and platforms, so we implement the hashing manually. and platforms, so we implement the hashing manually.
""" """
file = file.lower()
file = file.replace('\\','/')+":"+pp file = file.replace('\\','/')+":"+pp
# SDBM hash # SDBM hash
res = 0 res = 0
for t in file: for t in file:
res = (ord(t) + (res<<6) + (res<<16) - res) % 2**32 res = (ord(t) + (res<<6) + (res<<16) - res) % 2**32
return '{:x}'.format(res)
# Python 2.7 normalization: strip 'L' suffix.
return hex(res).rstrip('L')
# vim: ai ts=4 sts=4 et sw=4 # vim: ai ts=4 sts=4 et sw=4