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
@@ -16,15 +16,15 @@ from copienator import configuration
|
||||
from copienator.annotation_documents import tablet_documents
|
||||
|
||||
ANNOTATION_DIRECTORIES = ("BGnot", "Bnot", "Anot")
|
||||
IMPORT_DIR = getattr(configuration, "IMPORT_DIR", None)
|
||||
|
||||
|
||||
def clear_import_directory(workspace: EvaluationWorkspace) -> None:
|
||||
"""Empty the configured import folder while preserving the folder itself."""
|
||||
if IMPORT_DIR is None or not str(IMPORT_DIR).strip():
|
||||
import_dir = configuration.IMPORT_DIR
|
||||
if import_dir is None or not str(import_dir).strip():
|
||||
print("Aucun dossier d’import configuré ; aucun fichier supprimé.")
|
||||
return
|
||||
directory = Path(IMPORT_DIR).expanduser().resolve()
|
||||
directory = Path(import_dir).expanduser().resolve()
|
||||
if workspace.root.resolve().is_relative_to(directory) or Path.cwd().resolve().is_relative_to(directory):
|
||||
raise CliError(f"Le dossier d’import ne peut pas contenir l’évaluation ou le projet : {directory}",
|
||||
ExitCode.INVALID_ARGUMENTS)
|
||||
@@ -112,7 +112,7 @@ def run(
|
||||
return sync_annotated(
|
||||
workspace,
|
||||
annotation_dir_name="BRnot" if refaire else annotation_dir,
|
||||
import_dir=Path(IMPORT_DIR),
|
||||
import_dir=Path(configuration.IMPORT_DIR),
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user