Various HTML improvements
This commit is contained in:
1 parent
fd943696fb
commit
8c1fa0af57
16 files changed
+403
-45
No files matched your search
@@ -26,6 +26,8 @@ def _files_digest(paths) -> str:
|
||||
|
||||
|
||||
class AnnotationReadCache:
|
||||
state_file = STATE_FILE
|
||||
|
||||
def __init__(self, workspace, mode: str, data: dict, group_dirs=()):
|
||||
self.workspace = workspace
|
||||
self.mode = mode
|
||||
@@ -59,7 +61,7 @@ class AnnotationReadCache:
|
||||
return False
|
||||
directory = self.workspace.root / self.mode / f"Copie{copy_id}"
|
||||
try:
|
||||
state = read_json(directory / STATE_FILE)
|
||||
state = read_json(directory / self.state_file)
|
||||
return (state["signature"] == self.signatures[copy_id]
|
||||
and bool(state["outputs"])
|
||||
and all(Path(path).is_file() for path in state["outputs"]))
|
||||
@@ -82,7 +84,7 @@ class AnnotationReadCache:
|
||||
stem = destination.name.rsplit(" (", 1)[0]
|
||||
outputs.extend(path for suffix in (".jpg", ".pdf")
|
||||
if (path := destination / (stem + suffix)).is_file())
|
||||
atomic_write_json(directory / STATE_FILE, {
|
||||
atomic_write_json(directory / self.state_file, {
|
||||
"signature": self.signatures[copy_id],
|
||||
"outputs": [str(path) for path in outputs],
|
||||
})
|
||||
Reference in new issue
Block a user