mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 08:47:07 +00:00
Warn on import problems.
If there is a problem with files matching the capture globs but not matching the file name regexp patterns, these routines will emit a message to stderr and skip the non-matching file.
This commit is contained in:
@@ -51,6 +51,12 @@ if __name__ == '__main__':
|
||||
print("Importing")
|
||||
|
||||
match = rx.match(os.path.basename(filepath))
|
||||
if not match:
|
||||
error_message = f"File path not match the expected format! ({filepath} ~ {pattern['regex']})"
|
||||
print(error_message, file=sys.stderr)
|
||||
print("This file will be ignored!")
|
||||
continue
|
||||
|
||||
file_info = dict(zip(pattern["captures"], match.groups()))
|
||||
|
||||
p111_data = p111.from_file(filepath)
|
||||
|
||||
Reference in New Issue
Block a user