G3-A câblage moteur réel (engine_bridge.py) : EngineSettings + NerManagers à chargement paresseux (aucun manager à l'import), kwargs alignés CLI/V5 (make_vector_redaction=False, also_make_raster_burn=True, config_path, use_hf, ner/gliner/camembert_manager, ogc_label) ; make_process_fn engine injectable ; état managers not_loaded/loading/ready/unavailable, échecs optionnels tolérés. G3-B Configuration (config_state.py + tabs/tab_config.py) : ConfigState → EngineSettings, profils via profile_defaults (path injectable), options raster/NER local/profil/sortie, état managers, sections admin-only via admin_mode. G3-C Licence UI (machine_id.py + tab_about) : activation par clef (LicenseClient.activate), bouton vérifier (check), affichage statut, aucun token loggé, aucun appel réseau au démarrage (local_status seul). Intégration : tab_usage exécute via le moteur réel selon ConfigState (make_process_fn), anti double-lancement UI. app.py câble Config↔Usage↔licence. G3-D build-prep : anonymisation_gui_v6_onefile.spec (entry V6, customtkinter + modules gui_v6 en hiddenimports). Installateur Anonymisation.iss produit déjà la cible Anonymisation-Setup.exe. Aucun artefact .exe commité ; build Windows à part. Tests +14 (engine_bridge 8, config_state 6). self-test exit 0, 46 tests gui_v6, 193 tests/unit (0 régression). Moteur/V5/specs CLI intacts. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
61 lines
1.7 KiB
Python
61 lines
1.7 KiB
Python
#!/usr/bin/env python3
|
|
"""Point d'entrée de la GUI V6 de Pseudonymisation.
|
|
|
|
Usage :
|
|
python Pseudonymisation_Gui_V6.py # lance la fenêtre
|
|
python Pseudonymisation_Gui_V6.py --self-test # importe l'app, sort 0, sans fenêtre
|
|
|
|
Le mode ``--self-test`` vérifie que tout le socle GUI V6 s'importe correctement
|
|
(utile en CI / build sans display). Il n'ouvre aucune fenêtre.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
|
|
def _self_test() -> int:
|
|
"""Importe les modules du socle GUI V6 sans créer de fenêtre."""
|
|
from gui_v6 import ( # noqa: F401
|
|
app,
|
|
config_state,
|
|
engine_bridge,
|
|
license_client,
|
|
license_store,
|
|
machine_id,
|
|
processing_runner,
|
|
theme,
|
|
)
|
|
from gui_v6.tabs import tab_about, tab_config, tab_usage # noqa: F401
|
|
|
|
# Sanity check des contrats publics du socle.
|
|
assert hasattr(app, "AnonymisationApp")
|
|
assert hasattr(license_client, "LicenseClient")
|
|
assert hasattr(license_client, "LicenseStatus")
|
|
assert hasattr(license_store, "LicenseStore")
|
|
assert hasattr(processing_runner, "ProcessingRunner")
|
|
assert hasattr(engine_bridge, "make_process_fn")
|
|
assert hasattr(config_state, "ConfigState")
|
|
assert hasattr(machine_id, "default_machine_id")
|
|
assert hasattr(tab_about, "AboutTab")
|
|
assert hasattr(tab_config, "ConfigTab")
|
|
assert hasattr(tab_usage, "UsageTab")
|
|
print("GUI V6 self-test OK")
|
|
return 0
|
|
|
|
|
|
def main(argv=None) -> int:
|
|
argv = list(sys.argv[1:] if argv is None else argv)
|
|
if "--self-test" in argv:
|
|
return _self_test()
|
|
|
|
from gui_v6.app import AnonymisationApp
|
|
|
|
application = AnonymisationApp()
|
|
application.mainloop()
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(main())
|