mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 13:17:08 +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")
|
print("Importing")
|
||||||
|
|
||||||
match = rx.match(os.path.basename(filepath))
|
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()))
|
file_info = dict(zip(pattern["captures"], match.groups()))
|
||||||
|
|
||||||
p111_data = p111.from_file(filepath)
|
p111_data = p111.from_file(filepath)
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ if __name__ == '__main__':
|
|||||||
print("Importing")
|
print("Importing")
|
||||||
|
|
||||||
match = rx.match(os.path.basename(filepath))
|
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()))
|
file_info = dict(zip(pattern["captures"], match.groups()))
|
||||||
|
|
||||||
p190_data = p190.from_file(filepath, with_objrefs=True)
|
p190_data = p190.from_file(filepath, with_objrefs=True)
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ if __name__ == '__main__':
|
|||||||
print("Importing")
|
print("Importing")
|
||||||
|
|
||||||
match = rx.match(os.path.basename(filepath))
|
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()))
|
file_info = dict(zip(pattern["captures"], match.groups()))
|
||||||
|
|
||||||
p111_data = p111.from_file(filepath)
|
p111_data = p111.from_file(filepath)
|
||||||
|
|||||||
@@ -51,6 +51,12 @@ if __name__ == '__main__':
|
|||||||
print("Importing")
|
print("Importing")
|
||||||
|
|
||||||
match = rx.match(os.path.basename(filepath))
|
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()))
|
file_info = dict(zip(pattern["captures"], match.groups()))
|
||||||
|
|
||||||
p190_data = p190.from_file(filepath, with_objrefs=True)
|
p190_data = p190.from_file(filepath, with_objrefs=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user