Skip to content

pywry.scripts

JavaScript initialization script builder.


pywry.scripts.build_init_script

build_init_script(window_label: str, enable_hot_reload: bool = False) -> str

Build the core initialization script for a window.

This builds the CORE JavaScript bridges: - pywry bridge (emit, on, result, etc.) - theme manager - event bridge - toolbar bridge - cleanup handler - hot reload (optional)

NOTE: Plotly and AG Grid defaults are loaded separately via templates.py's build_plotly_script() and build_aggrid_script() functions, which include the library JS AND the defaults JS together.

Parameters:

Name Type Description Default
window_label str

The label for this window.

required
enable_hot_reload bool

Whether to include hot reload functionality.

False

Returns:

Type Description
str

The combined JavaScript initialization script.