reading grouped annotations ; to and from tablette

This commit is contained in:
2026-03-03 07:48:31 +01:00
parent 7a43be3ac1
commit 9acdb66bab
4 changed files with 291 additions and 3 deletions
+30
View File
@@ -0,0 +1,30 @@
import sys
import shutil
from pathlib import Path
def sync_annotated(dir_arg):
bgnot_dir = Path(dir_arg) / "BGnot"
annotated_dir = Path.home() / "SyncCopies" / "Annotées"
if not annotated_dir.is_dir():
print(f"Error: Directory {annotated_dir} does not exist.")
return
# Iterate over all PDF files in the annotated directory
for pdf_file in annotated_dir.glob("*.pdf"):
subdir_name = pdf_file.stem # 'f' from 'f.pdf'
target_subdir = bgnot_dir / subdir_name
if not target_subdir.is_dir():
print(f"Warning: Directory {target_subdir} not found.")
else:
dest_file = target_subdir / "Concat_annotated.pdf"
print("copying ", pdf_file, " to ", dest_file)
shutil.copy2(pdf_file, dest_file)
if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: python script.py <dir>")
sys.exit(1)
sync_annotated(sys.argv[1])