Skip to content

Commit

Permalink
commands.init:import_files - log skipped files that are not in Origin…
Browse files Browse the repository at this point in the history
…alDocuments
  • Loading branch information
MatteoCampinoti94 committed Dec 18, 2024
1 parent 9db8940 commit f0247af
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions digiarch/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,12 @@ def import_files(ctx: Context, avid: AVID, db: FilesDB, db_old: Connection, *log
for [path_str] in paths_cursor:
path = Path(path_str)
if "originaldocuments" not in (path_parts := [p.lower() for p in path.parts]):
Event.from_command(ctx, "skip").log(
WARNING,
*loggers,
path=path,
reason="File is not in OriginalDocuments",
)
continue
path = avid.dirs.original_documents.joinpath(*path_parts[path_parts.index("originaldocuments") + 1 :])
if not path.is_file():
Expand Down

0 comments on commit f0247af

Please sign in to comment.