Karana.WebUI.console#

Interactive, in-process Python console widget for Karana.WebUI.

Classes#

WebConsoleWidget

Compose an interactive Python session with a real Karana.WebUI.Widget.

Module Contents#

class Karana.WebUI.console.WebConsoleWidget(router: Karana.WebUI.Router, namespace: dict[str, Any] | None = None, *, capture_c_output: bool = True, max_transcript_bytes: int = 1024 * 1024)[source]#

Compose an interactive Python session with a real Karana.WebUI.Widget.

widget#
addToDomRoot() → None[source]#

Attach the underlying widget to WebUI’s document root.

close() → None[source]#

Stop the session and restore streams installed by this widget.

__enter__() → WebConsoleWidget[source]#

Return this widget for context-managed use.

__exit__(_exception_type: type[BaseException] | None, _exception: BaseException | None, _traceback: types.TracebackType | None) → None[source]#

Restore process state when leaving a context manager.