Allow signaling issues in label verification

This commit is contained in:
sebastien committed 2026-10-11 21:05:27 +02:00
1 parent 3754c0c11a
commit 9925362352
21 files changed
+1347 -36

No files matched your search

+11 -1
View File
@@ -16,6 +16,7 @@ from pydantic import BaseModel, Field
from copienator import configuration as config
from copienator.gemini_config import thinking_config
from copienator.copy_errors import marked_copy_paths
from copienator import (
CliError,
EvaluationWorkspace,
@@ -530,6 +531,7 @@ def run(
targets: list[Path],
*,
overwrite: bool = False,
marked: bool = False,
client=None,
sleep: Sleep = time.sleep,
max_workers: int = 12,
@@ -538,6 +540,12 @@ def run(
raise CliError("Le nombre de requêtes simultanées doit être positif.",
ExitCode.INVALID_ARGUMENTS)
workspace.require_files("labels")
if marked:
targets = marked_copy_paths(workspace)
if not targets:
print("No flagged copies to detect labels for.")
return ExitCode.SUCCESS
overwrite = True
images, warnings = selected_images(workspace, targets)
for warning in warnings:
print(f"Warning: {warning}")
@@ -626,6 +634,8 @@ def build_parser() -> argparse.ArgumentParser:
type=Path,
help="Additional copy PDFs or Cutleft images from the same evaluation",
)
parser.add_argument("--marked", action="store_true",
help="Regenerate labels only for copies with remaining flags")
parser.add_argument(
"--overwrite",
action="store_true",
@@ -664,7 +674,7 @@ def main(argv: Sequence[str] | None = None) -> int:
ExitCode.INVALID_ARGUMENTS,
)
targets.append(resolved)
return run(workspace, targets, overwrite=args.overwrite, max_workers=args.workers)
return run(workspace, targets, overwrite=args.overwrite, marked=args.marked, max_workers=args.workers)
return execute(parser, argv, handle)