runtimepy.net.server package#
Subpackages#
- runtimepy.net.server.app package
- Subpackages
- Submodules
- runtimepy.net.server.app.base module
- runtimepy.net.server.app.create module
- runtimepy.net.server.app.elements module
- runtimepy.net.server.app.files module
- runtimepy.net.server.app.placeholder module
- runtimepy.net.server.app.pyodide module
- runtimepy.net.server.app.sound module
- runtimepy.net.server.app.tab module
- Module contents
- runtimepy.net.server.struct package
- runtimepy.net.server.websocket package
- Submodules
- runtimepy.net.server.websocket.state module
- Module contents
RuntimepyDataWebsocketConnectionRuntimepyWebsocketConnectionRuntimepyWebsocketConnection.commandRuntimepyWebsocketConnection.disable_extra()RuntimepyWebsocketConnection.envRuntimepyWebsocketConnection.first_clientRuntimepyWebsocketConnection.first_messageRuntimepyWebsocketConnection.id_responsesRuntimepyWebsocketConnection.ids_waitingRuntimepyWebsocketConnection.init()RuntimepyWebsocketConnection.list_handlerRuntimepyWebsocketConnection.loggerRuntimepyWebsocketConnection.outgoing_commandsRuntimepyWebsocketConnection.processorRuntimepyWebsocketConnection.remote_environmentsRuntimepyWebsocketConnection.remote_metaRuntimepyWebsocketConnection.send_interfacesRuntimepyWebsocketConnection.tab_sender()RuntimepyWebsocketConnection.tabsRuntimepyWebsocketConnection.tx_binary_hwmRuntimepyWebsocketConnection.tx_text_hwmRuntimepyWebsocketConnection.ui_time
Submodules#
runtimepy.net.server.html module#
A module implementing HTML interfaces for web applications.
- async runtimepy.net.server.html.html_handler(apps: dict[str, Callable[[Html, RequestHeader, ResponseHeader, bytes | None], Awaitable[Html]]], stream: TextIO, request: RequestHeader, response: ResponseHeader, request_data: bytes | None, default_app: Callable[[Html, RequestHeader, ResponseHeader, bytes | None], Awaitable[Html]] = None) None[source]#
Render an HTML document in response to an HTTP request.
runtimepy.net.server.json module#
A module implementing basic JSON-object response handling.
- class runtimepy.net.server.json.Encoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#
Bases:
JSONEncoderA custom JSON encoder.
- runtimepy.net.server.json.json_handler(stream: TextIO, request: RequestHeader, response: ResponseHeader, request_data: bytes | None, data: Dict[str, str | int | float | bool | None | Dict[str, str | int | float | bool | None] | List[str | int | float | bool | None]]) None[source]#
Create an HTTP response from some JSON object data.
Module contents#
A module implementing a server interface for this package.
- class runtimepy.net.server.RuntimepyServerConnection(transport: Transport, protocol: QueueProtocol)[source]#
Bases:
HttpConnectionA class implementing a server-connection interface for this package.
- apps: dict[str, Callable[[Html, RequestHeader, ResponseHeader, bytes | None], Awaitable[Html]]] = {}#
- class_paths: list[Path | str | None] = [PosixPath('.'), PosixPath('/home/vkottler/src/vkottler/workspace/runtimepy/runtimepy/data')]#
- default_app: Callable[[Html, RequestHeader, ResponseHeader, bytes | None], Awaitable[Html]] | None = None#
- favicon_data: bytes#
- async get_handler(response: ResponseHeader, request: RequestHeader, request_data: bytes | None) bytes | None[source]#
Sample handler.
- json_data: Dict[str, str | int | float | bool | None | Dict[str, str | int | float | bool | None] | List[str | int | float | bool | None]] = {'test': {'a': 1, 'b': 2, 'c': 3}}#
- paths: list[Path]#
- try_file(path: Tuple[str, str | None], response: ResponseHeader) bytes | None[source]#
Try serving this path as a file directly from the file-system.