tables
controller.tables
Defines the FSMTable for displaying the FSM in a structured table format.
Classes
AppTreeTable
Bases: Table
Defines a table for the data from the app tree data.
Classes
Meta
Table meta options for rendering behavior and styling.
FSMTable
Bases: Table
Defines a table for the data from the FSM.
Classes
Meta
Table meta options for rendering behavior and styling.
Functions
from_dict(states, current_state)
classmethod
Create the FSM table from the states dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
states
|
dict[str, list[dict[str, str]]]
|
The FSM states and events. |
required |
current_state
|
str
|
The current state of the FSM. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The rendered FSM table. |
Source code in controller/tables.py
Functions
toggle_button(event, current)
Render a button that is disabled if the event is not the current state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
event
|
str
|
The text to display. |
required |
current
|
bool
|
Whether the event is the current state. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
SafeString
|
The button as a safe string. |
Source code in controller/tables.py
toggle_text(text, current)
Format the text to be displayed differently if it is the current state.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
text
|
str
|
The text to display. |
required |
current
|
bool
|
Whether the text is the current state. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
SafeString |
SafeString
|
The text as a safe string. |