Body Registry API¶
Source: ui/body_registry.py
Shared access to active shell bodies when navigation or search needs to reuse existing tile containers. See the Body registry concept.
Store shared tile bodies used by home and export screens (and in-place search).
BodyRegistry ¶
Process-wide registry for reusable home and export tile containers.
Source code in src/learning_app/ui/body_registry.py
set_home
classmethod
¶
Register the tile container used by the home route.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
TilesContainer
|
Home tile container to retain. |
required |
get_home
classmethod
¶
Return the registered home tile container.
Returns:
| Type | Description |
|---|---|
TilesContainer
|
The current home tile container. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If no home body has been registered. |
Source code in src/learning_app/ui/body_registry.py
has_home
classmethod
¶
Return whether a home tile container is registered.
Returns:
| Type | Description |
|---|---|
bool
|
|
set_export
classmethod
¶
Register the tile container used by the export workflow.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
body
|
TilesContainer
|
Export tile container to retain. |
required |
get_export
classmethod
¶
Return the registered export tile container.
Returns:
| Type | Description |
|---|---|
TilesContainer
|
The current export tile container. |
Raises:
| Type | Description |
|---|---|
AssertionError
|
If no export body has been registered. |
Source code in src/learning_app/ui/body_registry.py
has_export
classmethod
¶
Return whether an export tile container is registered.
Returns:
| Type | Description |
|---|---|
bool
|
|