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
@@ -13,6 +13,7 @@ from copienator import (
|
||||
workspace_from_args,
|
||||
)
|
||||
from copienator import configuration
|
||||
from copienator.annotation_documents import tablet_documents
|
||||
|
||||
ANNOTATION_DIRECTORIES = ("BGnot", "Bnot", "Anot")
|
||||
IMPORT_DIR = getattr(configuration, "IMPORT_DIR", None)
|
||||
@@ -58,6 +59,7 @@ def sync_annotated(
|
||||
return ExitCode.INVALID_WORKSPACE
|
||||
|
||||
missing_targets = 0
|
||||
targets = dict(tablet_documents(annotation_dir))
|
||||
annotated_files = sorted(
|
||||
(
|
||||
path
|
||||
@@ -70,10 +72,11 @@ def sync_annotated(
|
||||
if prefix and not annotated_file.stem.startswith(prefix):
|
||||
print(f"Ignoring return from another pass: {annotated_file.name}")
|
||||
continue
|
||||
target_subdir = annotation_dir / annotated_file.stem.removeprefix(prefix)
|
||||
name = annotated_file.stem.removeprefix(prefix)
|
||||
target_subdir = targets.get(name)
|
||||
|
||||
if not target_subdir.is_dir():
|
||||
print(f"Warning: directory not found: {target_subdir}", file=sys.stderr)
|
||||
if target_subdir is None or not target_subdir.is_dir():
|
||||
print(f"Warning: annotation document not found: {name}", file=sys.stderr)
|
||||
missing_targets += 1
|
||||
else:
|
||||
suffix = annotated_file.suffix.lower()
|
||||
|
||||
Reference in new issue
Block a user