Initial support for user general remarks
This commit is contained in:
1 parent
a38c1ff4b3
commit
2c9dc65640
16 files changed
+606
-20
No files matched your search
@@ -7,6 +7,7 @@ from copienator import atomic_write_json, configuration, read_json
|
||||
from copienator.annotation_documents import copy_documents
|
||||
from copienator.return_answers import load_return_answer_options
|
||||
from copienator.custom_remarks import load_remarks, copy_key
|
||||
from copienator import general_remarks
|
||||
|
||||
STATE_FILE = ".annotation-read-state.json"
|
||||
DOCUMENT_INPUTS = ("bnote.json", "checkboxes.json", "Reference.jpg", "Concat_annotated.pdf")
|
||||
@@ -40,6 +41,7 @@ class AnnotationReadCache:
|
||||
configuration.RETURN_JPEG_ENABLED, configuration.RETURN_PDF_ENABLED,
|
||||
configuration.LATEX_ANOT_BEFORE, configuration.LATEX_ANOT_AFTER)
|
||||
remarks = load_remarks(root)
|
||||
general = general_remarks.load_remarks(root)
|
||||
for copy_id, labels in data.items():
|
||||
directory = root / mode / f"Copie{copy_id}"
|
||||
paths = [directory / "score.json", directory / "bnote.json"]
|
||||
@@ -48,7 +50,7 @@ class AnnotationReadCache:
|
||||
for content in labels.values():
|
||||
pdf = Path(content["pdf_path"])
|
||||
paths.extend((pdf, pdf.with_suffix(".layout.json")))
|
||||
payload = json.dumps((2, common, labels, remarks.get(copy_key(copy_id), {}), _files_digest(paths)),
|
||||
payload = json.dumps((3, common, labels, general.get(copy_key(copy_id), []), remarks.get(copy_key(copy_id), {}), _files_digest(paths)),
|
||||
sort_keys=True, default=str).encode()
|
||||
self.signatures[copy_id] = sha256(payload).hexdigest()
|
||||
|
||||
@@ -69,6 +71,7 @@ class AnnotationReadCache:
|
||||
info = read_json(directory / "info.json")
|
||||
outputs.extend(directory / f"{label}.jpg" for label, entry in info.items()
|
||||
if entry["present"])
|
||||
outputs.extend(directory.glob(general_remarks.IMAGE_FILENAME))
|
||||
outputs.extend(directory.glob("Concat*.*"))
|
||||
outputs.extend(directory.glob(".annotation-base-*.png"))
|
||||
outputs.extend(directory.glob("annotation_baseline.json"))
|
||||
|
||||
Reference in new issue
Block a user