Various HTML improvements
This commit is contained in:
1 parent
fd943696fb
commit
8c1fa0af57
16 files changed
+403
-45
No files matched your search
@@ -5,9 +5,19 @@ from copienator.commands.reading_annotations import apply_actions_and_regenerate
|
||||
from copienator.commands.reading_grouped_annotations import apply_actions_and_regenerate_grouped
|
||||
|
||||
|
||||
def run(workspace: EvaluationWorkspace, mode: str):
|
||||
def run(workspace: EvaluationWorkspace, mode: str, *, incremental: bool = False):
|
||||
directories = sorted((p for p in (workspace.root / mode).glob('Copie*')
|
||||
if p.is_dir() and p.name[5:].isdigit() and (p / 'score.json').is_file()))
|
||||
from copienator.reviewed_cache import ReviewedReadCache
|
||||
cache = ReviewedReadCache(workspace, mode, directories) if incremental else None
|
||||
if cache:
|
||||
pending = []
|
||||
for directory in directories:
|
||||
if cache.unchanged(directory.name[5:]):
|
||||
print(f"Skipping unchanged {directory.name}", flush=True)
|
||||
else:
|
||||
pending.append(directory)
|
||||
directories = pending
|
||||
# Validate every snapshot before starting to publish any copy.
|
||||
for directory in directories:
|
||||
if not (directory / FILENAME).is_file():
|
||||
@@ -29,10 +39,14 @@ def run(workspace: EvaluationWorkspace, mode: str):
|
||||
print(log, flush=True)
|
||||
if result != ExitCode.SUCCESS:
|
||||
status = ExitCode.PARTIAL
|
||||
elif cache:
|
||||
# Rendering can normalize the saved snapshot; fingerprint the published inputs.
|
||||
ReviewedReadCache(workspace, mode, [directory]).remember([cid])
|
||||
return status
|
||||
|
||||
|
||||
def main(argv=None):
|
||||
parser = evaluation_parser('Regenerate from saved reviewed inputs without rescanning handwriting')
|
||||
parser.add_argument('--annotation-dir', choices=('Bnot', 'BGnot'), required=True)
|
||||
return execute(parser, argv, lambda args: run(workspace_from_args(args), args.annotation_dir))
|
||||
parser.add_argument("--incremental", action="store_true", help="Skip unchanged copies")
|
||||
return execute(parser, argv, lambda args: run(workspace_from_args(args), args.annotation_dir, incremental=args.incremental))
|
||||
Reference in new issue
Block a user