exlab_wizard.window.pywebview_app#

pywebview-driven native window. Backend Spec §15.3.2.

Opens a single pywebview window pointed at http://127.0.0.1:<port> from the handshake. Window title, size, and icon are hard-coded here per §15.3.2; devtools are gated by the EXLAB_DEBUG env var so release artifacts never enable them.

The actual webview import is deferred and isolated behind helper functions so unit tests on a headless host can exercise URL building, debug flag detection, and the assembly path without booting a real webview backend.

Functions

build_window_url(handshake)

Return the URL the window points at.

is_debug_enabled()

True when EXLAB_DEBUG is set to a truthy string.

run_window(handshake, *[, create_window, start])

Open a single pywebview window pointed at the handshake's port.

exlab_wizard.window.pywebview_app.build_window_url(handshake)[source]#

Return the URL the window points at.

Always loopback (Backend §4.1: “binds to 127.0.0.1 only”); the handshake’s port is mandatory.

Parameters:

handshake (ServerHandshake)

Return type:

str

exlab_wizard.window.pywebview_app.is_debug_enabled()[source]#

True when EXLAB_DEBUG is set to a truthy string. Backend §15.3.2.

Return type:

bool

exlab_wizard.window.pywebview_app.run_window(handshake, *, create_window=None, start=None)[source]#

Open a single pywebview window pointed at the handshake’s port.

create_window and start are dependency-injection hooks for tests; production code defers to webview.create_window and webview.start. Returns 0 on clean exit.

Parameters:
Return type:

int