Restructuration de l'application
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
from pathlib import Path
|
||||
|
||||
from copienator_gui.app import CopienatorApp
|
||||
|
||||
|
||||
def personal_steps_enabled() -> bool:
|
||||
try:
|
||||
from copienator.configuration import SHOW_PERSONAL_STEPS
|
||||
except (ImportError, AttributeError):
|
||||
return False
|
||||
return bool(SHOW_PERSONAL_STEPS)
|
||||
|
||||
|
||||
def main(argv=None) -> int:
|
||||
parser = argparse.ArgumentParser(description="Interface graphique du workflow Copienator")
|
||||
parser.add_argument("evaluation", nargs="?", type=Path, help="Dossier d’évaluation à ouvrir")
|
||||
args = parser.parse_args(argv)
|
||||
|
||||
repository = Path.cwd().resolve()
|
||||
evaluation = args.evaluation.resolve() if args.evaluation else None
|
||||
app = CopienatorApp(repository, personal_steps_enabled(), evaluation)
|
||||
app.mainloop()
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user