mixins: moved debug logs to 'filter_file'. Renamed shadowed variable name.

Following comments from Todd:

- the call to tty.debug has been moved deeper, to log the filtering of each file
- the shadowing on the name "kwargs" is avoided
This commit is contained in:
alalazo
2017-08-02 12:51:12 +02:00
committed by Todd Gamblin
parent a01a68218c
commit 4e48bae096
2 changed files with 16 additions and 11 deletions

View File

@@ -119,9 +119,15 @@ def groupid_to_group(x):
regex = re.escape(regex)
for filename in filenames:
msg = 'FILTER FILE: {0} [replacing "{1}"]'
tty.debug(msg.format(filename, regex))
backup_filename = filename + "~"
if ignore_absent and not os.path.exists(filename):
msg = 'FILTER FILE: file "{0}" not found. Skipping to next file.'
tty.debug(msg.format(filename))
continue
# Create backup file. Don't overwrite an existing backup