Support evaluation-local configuration and names overrides
This commit is contained in:
1 parent
0bb6f7d97c
commit
d4404e4c27
36 files changed
+409
-184
No files matched your search
+14
-1
@@ -11,7 +11,7 @@ from pathlib import Path
|
||||
from tkinter import filedialog, messagebox, ttk
|
||||
from typing import Any
|
||||
|
||||
from copienator import CliError, EvaluationWorkspace, ExitCode, atomic_write_json, read_json
|
||||
from copienator import configuration, CliError, EvaluationWorkspace, ExitCode, atomic_write_json, read_json
|
||||
from copienator.commands.resolve_manual import pending_manual_conflicts
|
||||
from copienator.copy_errors import copy_errors
|
||||
from copienator.orientation import reports as orientation_reports
|
||||
@@ -275,6 +275,7 @@ class CopienatorApp(tk.Tk):
|
||||
super().__init__()
|
||||
self.repository = repository.resolve()
|
||||
self.show_personal_steps = show_personal_steps
|
||||
self._global_personal_steps = show_personal_steps
|
||||
self.steps = build_workflow(show_personal_steps)
|
||||
self.step_by_id = {step.id: step for step in self.steps}
|
||||
self.state_store = StateStore()
|
||||
@@ -739,10 +740,22 @@ class CopienatorApp(tk.Tk):
|
||||
if not evaluation or not evaluation.is_dir():
|
||||
messagebox.showerror("Dossier invalide", "Choisissez un dossier d’évaluation existant.")
|
||||
return
|
||||
try:
|
||||
configuration.use_evaluation(evaluation)
|
||||
except Exception as exc:
|
||||
messagebox.showerror("Configuration invalide", str(exc))
|
||||
return
|
||||
self.batch_monitor.stop()
|
||||
self._reset_latex_warnings()
|
||||
self._save_current_form()
|
||||
self.state_store.load(evaluation)
|
||||
self.show_personal_steps = (
|
||||
bool(configuration.SHOW_PERSONAL_STEPS)
|
||||
if configuration.LOCAL_CONFIG_PATH is not None
|
||||
else self._global_personal_steps
|
||||
)
|
||||
self.steps = build_workflow(self.show_personal_steps)
|
||||
self.step_by_id = {step.id: step for step in self.steps}
|
||||
for step in self.steps:
|
||||
if self.state_store.step(step.id).get("status") == "running":
|
||||
self.state_store.update_step(step.id, status="interrupted")
|
||||
|
||||
@@ -8,7 +8,6 @@ from dataclasses import dataclass
|
||||
from pathlib import Path
|
||||
|
||||
from copienator import configuration
|
||||
from copienator.configuration import ALWAYS_CROP
|
||||
|
||||
EVALUATION = "${evaluation}"
|
||||
EVALUATION_NAME = "${evaluation_name}"
|
||||
@@ -295,7 +294,7 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
),
|
||||
optional=True,
|
||||
requires=("Copies",),
|
||||
auto_start_first_visit=ALWAYS_CROP,
|
||||
auto_start_first_visit=configuration.ALWAYS_CROP,
|
||||
),
|
||||
StepDefinition(
|
||||
"cutleft",
|
||||
@@ -435,7 +434,7 @@ def build_workflow(show_personal_steps: bool) -> list[StepDefinition]:
|
||||
),
|
||||
optional=True,
|
||||
requires=("Copies/Copie*/*.pdf",),
|
||||
auto_start_first_visit=ALWAYS_CROP,
|
||||
auto_start_first_visit=configuration.ALWAYS_CROP,
|
||||
),
|
||||
StepDefinition(
|
||||
"grouping",
|
||||
|
||||
Reference in new issue
Block a user