Support for post annotation label reassignement.

This commit is contained in:
sebastien committed 2026-10-11 19:03:04 +02:00
1 parent 698ac4240c
commit 370f3252ef
10 files changed
+242 -36

No files matched your search

+5 -4
View File
@@ -37,9 +37,10 @@ Enregistrez dans l’éditeur, puis cliquez sur Recharger et enfin sur Exécuter
class ManualResolutionPanel(ttk.Frame):
def __init__(self, parent, get_evaluation):
def __init__(self, parent, get_evaluation, *, help_text=HELP, show_provenance=True):
super().__init__(parent)
self.get_evaluation = get_evaluation
self.show_provenance = show_provenance
self.pdf_buttons = []
self.cut_buttons = []
self.copy_buttons = []
@@ -67,7 +68,7 @@ class ManualResolutionPanel(ttk.Frame):
self.text.configure(yscrollcommand=scroll.set)
scroll.pack(side="right", fill="y")
self.text.pack(fill="both", expand=True)
ttk.Label(self, text=HELP, wraplength=650, justify="left").pack(fill="x", pady=8)
ttk.Label(self, text=help_text, wraplength=650, justify="left").pack(fill="x", pady=8)
self.reload()
def manual_path(self) -> Path | None:
@@ -123,7 +124,7 @@ class ManualResolutionPanel(ttk.Frame):
raise FileNotFoundError("Chargez une évaluation.")
content = path.read_text(encoding="utf-8")
except (OSError, UnicodeError) as exc:
self.status.configure(text=f"manual_resolutions.txt indisponible : {exc}")
self.status.configure(text=f"{path.name if path else 'Fichier'} indisponible : {exc}")
else:
self.editor_button.configure(state="normal")
malformed = []
@@ -142,7 +143,7 @@ class ManualResolutionPanel(ttk.Frame):
key = (instruction.copy_id, instruction.old_label)
if key not in provenance:
try:
provenance[key] = populated_labels(path.parent, *key)
provenance[key] = populated_labels(path.parent, *key) if self.show_provenance else []
except (OSError, ValueError) as exc:
provenance[key] = []
provenance_error = f" — Provenance indisponible : {exc}"