fix handling of files with non-matching names...

This commit is contained in:
Fredrik Eriksson 2020-12-21 12:57:53 +01:00
parent 863d7e77f8
commit 0e61eee899
Signed by: feffe
GPG Key ID: F4329687B0FA7F8D

View File

@ -19,7 +19,9 @@ def get_files_in_dir(path, regex, timeformat, recurse=False):
for root,dirs,files in os.walk(path, topdown=False): for root,dirs,files in os.walk(path, topdown=False):
for f in files: for f in files:
prefix, timestamp = parse_filename(f, regex, timeformat) prefix, timestamp = parse_filename(f, regex, timeformat)
if prefix and prefix not in res: if not prefix:
continue
if prefix not in res:
res[prefix] = set() res[prefix] = set()
res[prefix].add((os.path.join(root,f), timestamp)) res[prefix].add((os.path.join(root,f), timestamp))
if not recurse: if not recurse: