Bnot : split large copies into pieces.
This commit is contained in:
1 parent
834ffe32f2
commit
1959c5d3bb
10 files changed
+333
-52
No files matched your search
@@ -11,6 +11,7 @@ from copienator import (
|
||||
workspace_from_args,
|
||||
)
|
||||
from copienator.configuration import EXPORT_DIR
|
||||
from copienator.annotation_documents import tablet_documents
|
||||
from copienator.platform import replace_with_link_or_copy
|
||||
|
||||
ANNOTATION_DIRECTORIES = ("BGnot", "Bnot", "Anot")
|
||||
@@ -36,7 +37,9 @@ def export_directory(
|
||||
subdirs = [directory for directory in subdirs if not directory.name.startswith("Copie")]
|
||||
|
||||
missing_outputs = 0
|
||||
for subdir in subdirs:
|
||||
for name, subdir in tablet_documents(source_dir):
|
||||
if subdir not in subdirs and subdir.parent not in subdirs:
|
||||
continue
|
||||
concat_file = next(
|
||||
(
|
||||
candidate
|
||||
@@ -52,7 +55,7 @@ def export_directory(
|
||||
)
|
||||
missing_outputs += 1
|
||||
continue
|
||||
destination = sync_dir / f"{prefix}{subdir.name}{concat_file.suffix.lower()}"
|
||||
destination = sync_dir / f"{prefix}{name}{concat_file.suffix.lower()}"
|
||||
method = replace_with_link_or_copy(concat_file, destination, prefer="hardlink")
|
||||
print(f"Exported: {destination} ({method})")
|
||||
return ExitCode.PARTIAL if missing_outputs else ExitCode.SUCCESS
|
||||
|
||||
Reference in new issue
Block a user