exlab_wizard.tray.status#
Status-submenu rendering. Backend Spec §4.3.2.
The tray’s status submenu shows live state derived from server-side
components: SessionStore.active_sessions,
NASSyncClient.queue_depth, Validator.audit_summary. The string
follows the §4.3.2 formatter:
"Idle"– nothing in progress."Sync: <N> jobs"– N >= 1 NAS-sync jobs in queue."<N> plugin needs input"– one or more sessions inINPUT_REQUIRED(the warning emoji is omitted from the canonical formatter; pystray menu labels are plain text).Combined when multiple conditions hold (e.g.
"Sync: 2 jobs; 1 plugin needs input").
A 5-second StatusTicker re-evaluates the formatter and notifies
a callback the tray uses to refresh the menu label. The ticker runs on
a daemon thread; tests can drive a single tick deterministically by
calling StatusTicker.tick_once().
Functions
|
Return the menu-label string for the §4.3.2 formatter. |
|
Build a |
Classes
|
Immutable view over the §4.3.2 status inputs. |
|
Polls |
- class exlab_wizard.tray.status.StatusSnapshot(active_sessions=0, sync_queue_depth=0, input_required_count=0)[source]#
Bases:
objectImmutable view over the §4.3.2 status inputs.
- class exlab_wizard.tray.status.StatusTicker(*, session_store=None, nas_sync=None, on_update=None, interval_seconds=5.0)[source]#
Bases:
objectPolls
snapshot_status()on a fixed cadence.On every tick the formatted string is computed; if it differs from the previous label the
on_updatecallback is invoked with the new label. The callback is the tray menu’s “set status text” hook; tests pass a recording callable.- Parameters:
- exlab_wizard.tray.status.format_status(snapshot)[source]#
Return the menu-label string for the §4.3.2 formatter.
- Parameters:
snapshot (
StatusSnapshot)- Return type:
- exlab_wizard.tray.status.snapshot_status(*, session_store=None, nas_sync=None)[source]#
Build a
StatusSnapshotfrom live component references.Each component is read defensively so the launcher can pass
None(setup-incomplete state) without the formatter crashing. The function readsactive_sessionsandinput_required-style counts fromsession_storeandin_flight_jobs/queue_depthfromnas_sync.- Parameters:
- Return type: