httk.serve.web.widgets.assets¶
Engine-owned registration for trusted widget assets.
Exceptions¶
Report conflicting declarations for one widget asset path. |
Classes¶
Register immutable widget assets for one engine instance. |
Module Contents¶
- exception httk.serve.web.widgets.assets.WidgetAssetConflictError(path)[source]¶
Bases:
ValueErrorReport conflicting declarations for one widget asset path.
- Parameters:
path (str) – Conflicting deployment-relative asset path.
- class httk.serve.web.widgets.assets.WidgetAssetRegistry[source]¶
Register immutable widget assets for one engine instance.
Registration is atomic across a batch and rejects conflicting content before changing the registry.
- register(asset)[source]¶
Register one widget asset.
- Parameters:
asset (httk.serve.web.widgets.core.WidgetAsset) – Asset declaration to register.
- Returns:
The registered asset.
- Raises:
WidgetAssetConflictError – If the path has different content.
- Return type:
- register_many(assets)[source]¶
Register a batch after preflighting every conflict.
- Parameters:
assets (tuple[httk.serve.web.widgets.core.WidgetAsset, Ellipsis]) – Asset declarations to register.
- Returns:
Registered assets in input order.
- Raises:
WidgetAssetConflictError – If any path has different content.
- Return type:
tuple[httk.serve.web.widgets.core.WidgetAsset, Ellipsis]