Address review comments by @danielquinn

This commit is contained in:
Michael Gmelin
2019-09-08 17:00:02 +02:00
parent 14b81c613c
commit 9ff467eb9b
2 changed files with 6 additions and 6 deletions

View File

@@ -484,11 +484,15 @@ class FileInfo:
"""
filename = os.path.basename(path)
# Mutate filename in-place before parsing its components
# by applying at most one of the configured transformations.
for (pattern, repl) in settings.FILENAME_PARSE_TRANSFORMS:
(filename, count) = pattern.subn(repl, filename)
if count:
break
# Parse filename components.
for regex in cls.REGEXES.values():
m = regex.match(filename)
if m: