35 lines
832 B
Python
35 lines
832 B
Python
from __future__ import annotations
|
|
|
|
import sys
|
|
|
|
|
|
def main() -> int:
|
|
"""Dispatch the common GUI path without importing every CLI operation."""
|
|
|
|
arguments = sys.argv[1:]
|
|
if not arguments or arguments == ["gui"]:
|
|
from .paths import AppPaths
|
|
from .umu import provision_umu_for_startup
|
|
|
|
try:
|
|
paths = AppPaths.from_environment()
|
|
# Older installed releases cannot run a bootstrap step that only exists
|
|
# in their update payload. Their automatic restart enters here instead.
|
|
provision_umu_for_startup(paths)
|
|
from .ui import run_dashboard
|
|
|
|
run_dashboard(paths)
|
|
except KeyboardInterrupt:
|
|
return 130
|
|
except (ValueError, OSError, RuntimeError) as exc:
|
|
print(f"Error: {exc}", file=sys.stderr)
|
|
return 1
|
|
return 0
|
|
|
|
from .cli import main as cli_main
|
|
|
|
return cli_main(arguments)
|
|
|
|
|
|
raise SystemExit(main())
|