Refonte de la couche présentation pour reprendre docs/ui_mockup_v6.html, sans changer de techno UI ni la logique G1-G3. - theme.py : 4 thèmes aux tokens EXACTS de la maquette (sombre #1a1a2e/#16213e/ #e94560, clair, médical, neutre), palette complète + status_color. - ui_kit.py (nouveau) : composants stylés (Card titrée, boutons primary/secondary/ success/pilule, StatCard, ToggleRow) appliquant la palette. - app.py : shell étroit, header identité + version + statut licence + liseré accent, barre d'onglets custom (plus de CTkTabview brut), navigation par recréation, changement de thème à chaud. - tab_usage : carte Apparence (sélecteur de thème), dropzone stylée, grille formats, barre d'actions, progression à étapes + journal, résultats en cartes statistiques. - tab_config : sous-navigation Réglages/Masquage/Partage/Règles ; Réglages câblé au ConfigState (profil, moteurs NER, dossier sortie). - tab_about : grille d'informations + bloc licence (logique inchangée). Logique inchangée : engine_bridge, config_state, license_client/store, runner. Tests : +9 (theme). self-test exit 0, 55 tests gui_v6, 202 tests/unit (0 régression). Smoke construction headless (Xvfb) : 3 onglets × 4 thèmes rendus sans erreur. Pas de pywebview, aucun .exe. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
64 lines
1.9 KiB
Python
64 lines
1.9 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,
|
|
ui_kit,
|
|
)
|
|
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(ui_kit, "Card")
|
|
assert hasattr(theme, "PALETTES") and set(theme.PALETTES) >= {"sombre", "clair", "medical", "neutre"}
|
|
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())
|