exlab_wizard.tray.main#
exlab-wizard-tray console_scripts entry point. Backend Spec §4.3.2.
Wires the long-lived process:
Configure logging.
Build / load the FastAPI app.
Construct
AutostartManager,ServerRunner,WindowLauncher,QuitCoordinator,StatusTicker, andNotificationBus.Build the pystray
Iconand run its event loop.
The orchestration is intentionally light – each component owns its own
lifecycle; main() is the assembly point. Tests cover the wiring by
constructing TrayApp directly with stub components; the real
main() resolves production wiring (FastAPI app + state dir) and
delegates.
Functions
|
|
Classes
|
Bundle of long-lived tray components. |
- class exlab_wizard.tray.main.TrayApp(server_runner, window_launcher, quit_coordinator, status_ticker, notification_bus, autostart, icon=None)[source]#
Bases:
objectBundle of long-lived tray components.
The launcher constructs one and calls
run(); tests build one with stub components and exerciseshutdown()/open()individually.- Parameters:
server_runner (
ServerRunner)window_launcher (
WindowLauncher)quit_coordinator (
QuitCoordinator)status_ticker (
StatusTicker)notification_bus (
NotificationBus)autostart (
AutostartManager)icon (
Any)
- autostart: AutostartManager#
- notification_bus: NotificationBus#
- quit_coordinator: QuitCoordinator#
- run(*, run_loop=None)[source]#
Start the server, build the icon, run the pystray loop.
run_loopis injected by tests so they don’t actually callIcon.run(which would block on a real backend). Returns the exit code.
- server_runner: ServerRunner#
- status_ticker: StatusTicker#
- window_launcher: WindowLauncher#