runtimepy.net.server.app package#

Subpackages#

Submodules#

runtimepy.net.server.app.base module#

A module implementing a web application base.

class runtimepy.net.server.app.base.WebApplication(app: AppInfo)[source]#

Bases: object

A simple web-application interface.

populate(document: Html, app: Callable[[TabbedContent], None]) None[source]#

Populate the body element with the application.

ui_classes = ['WindowHashManager', 'WorkerInterface', 'PlotModalManager', 'Plot', 'ChannelTable', 'TabInterface', 'TabFilter', 'App']#
worker_classes = ['JsonConnection', 'DataConnection', 'PointBuffer', 'PointManager', 'UnitSystem', 'OverlayManager', 'PlotDrawer', 'PlotManager']#

runtimepy.net.server.app.create module#

A module implementing a simple application harnessing interface.

runtimepy.net.server.app.create.config_param(app: AppInfo, key: str, default: T, strict: bool = False) T[source]#

Attempt to get a configuration parameter.

runtimepy.net.server.app.create.create_app(app: AppInfo, compose: Callable[[AppInfo, TabbedContent], None]) Callable[[Html, RequestHeader, ResponseHeader, bytes | None], Awaitable[Html]][source]#

Create a web-application handler.

runtimepy.net.server.app.create.create_cacheable_app(app: AppInfo, compose: Callable[[AppInfo, Html, RequestHeader, ResponseHeader, bytes | None], Html]) Callable[[Html, RequestHeader, ResponseHeader, bytes | None], Awaitable[Html]][source]#

Create a web application-serving method capable of automatically caching the originally composed document.

runtimepy.net.server.app.elements module#

A module implementing some basic HTML element interfaces.

runtimepy.net.server.app.elements.kind(name: str, parent: Element = None, **kwargs) Element[source]#

Get an element populated with content from a file.

runtimepy.net.server.app.files module#

A module implementing interfaces for working with file contents.

runtimepy.net.server.app.files.set_text_to_file(element: Element, *args, **kwargs) bool[source]#

Set an element’s text to the contents of a file.

runtimepy.net.server.app.files.set_text_to_kind(element: Element, kind: str, name: str, package: str = 'runtimepy', subdir: str = None) bool[source]#

Set text to HTML-file contents at a predictable path.

runtimepy.net.server.app.landing_page module#

A module for developing and testing a top-level landing page idea (#239).

runtimepy.net.server.app.landing_page.landing_page(app: AppInfo, document: Html, request: RequestHeader, response: ResponseHeader, request_data: bytes | None) Html[source]#

Create a landing page application

runtimepy.net.server.app.placeholder module#

A module implementing some placeholder widget utilities.

class runtimepy.net.server.app.placeholder.DummyTab(name: str, app: AppInfo, tabs: TabbedContent, source: str = None, subdir: str = 'tab', icon: str = None)[source]#

Bases: Tab

A dummy tab for testing.

compose(parent: Element) None[source]#

Compose the tab’s HTML elements.

runtimepy.net.server.app.placeholder.dummy_tabs(count: int, app: AppInfo, tabs: TabbedContent) None[source]#

Add some placeholder tabs.

runtimepy.net.server.app.placeholder.under_construction(parent: Element, note: str = '', **kwargs) Element[source]#

Add some ‘under construction’ content to the tab area.

runtimepy.net.server.app.pyodide module#

A module implementing interfaces to the pyodide project.

runtimepy.net.server.app.pyodide.add_pyodide_js(element: Element) Element[source]#

Add bootstrap JavaScript as a child of element.

runtimepy.net.server.app.sound module#

A module implementing a tab for experimenting with sound generation.

class runtimepy.net.server.app.sound.SoundTab(name: str, app: AppInfo, tabs: TabbedContent, source: str = None, subdir: str = 'tab', icon: str = None)[source]#

Bases: Tab

A simple sound-tab interface class.

compose(parent: Element) None[source]#

Compose the tab’s HTML elements.

runtimepy.net.server.app.tab module#

A module implementing an application tab interface.

class runtimepy.net.server.app.tab.Tab(name: str, app: AppInfo, tabs: TabbedContent, source: str = None, subdir: str = 'tab', icon: str = None)[source]#

Bases: object

A simple application-tab interface class.

compose(parent: Element) None[source]#

Compose the tab’s HTML elements.

entry() None[source]#

Tab overall script entry.

init() None[source]#

Initialize this instance.

write_js(writer: IndentedFileWriter, **kwargs) bool[source]#

Write JavaScript code for the tab.

Module contents#

A module implementing application methods for this package’s server interface.

async runtimepy.net.server.app.launch_browser(app: AppInfo) None[source]#

Attempts to launch browser windows/tabs if any ‘http_server’ server ports are configured.

async runtimepy.net.server.app.setup(app: AppInfo) int[source]#

Perform server application setup steps.