yasmin_editor.editor_gui.runtime_state module
Pure runtime state helpers shared by the editor runtime mixin.
The runtime mixin still owns the Qt-facing orchestration, but several decisions inside it are not inherently graphical: button visibility, the currently active state inside one container view, and the local transition that should be highlighted. Keeping those rules in one Qt-free module makes them easier to review, document, and test without a live editor window.
- class yasmin_editor.editor_gui.runtime_state.RuntimeButtonState(visible: bool, enabled: bool)
Bases:
objectVisibility and enabled state for one runtime control button.
- enabled: bool
- visible: bool
- class yasmin_editor.editor_gui.runtime_state.RuntimeLocalTransition(from_name: str, to_name: str, outcome: str)
Bases:
objectTransition projected into the currently visible container.
- from_name: str
- outcome: str
- to_name: str
- class yasmin_editor.editor_gui.runtime_state.RuntimeViewState(mode_enabled: bool, ready: bool, running: bool, blocked: bool, playing: bool, step_mode: bool, finished: bool, shell_execution_blocked: bool = False)
Bases:
objectSnapshot of the runtime state needed by the editor controls.
- blocked: bool
- finished: bool
- mode_enabled: bool
- playing: bool
- ready: bool
- running: bool
- shell_execution_blocked: bool
- step_mode: bool
- yasmin_editor.editor_gui.runtime_state.build_runtime_view_state(runtime_mode_enabled: bool, runtime, shell_execution_blocked: bool = False) RuntimeViewState
Compute the runtime-control flags used by the editor window.
- yasmin_editor.editor_gui.runtime_state.current_runtime_container_path(explicit_path: tuple[str, ...] | list[str] | None, current_container_path) tuple[str, ...]
Return the container path currently shown by the editor.
Runtime mode can explicitly track the visible runtime container path. When that is not set yet, the editor falls back to the current model container stack, excluding the synthetic root entry.
- yasmin_editor.editor_gui.runtime_state.local_runtime_transition(transition: tuple[tuple[str, ...], tuple[str, ...], str] | None, current_path: tuple[str, ...] | list[str] | None) RuntimeLocalTransition | None
Project one runtime transition into the currently visible container.
- yasmin_editor.editor_gui.runtime_state.normalize_runtime_path(path: tuple[str, ...] | list[str] | None) tuple[str, ...]
Normalize arbitrary runtime paths to a tuple of non-empty strings.
- yasmin_editor.editor_gui.runtime_state.root_final_transition(root_state_name: str, transitions_by_state: dict[str, list[object]], outcome: str | None) tuple[tuple[str, ...], tuple[str, ...], str] | None
Resolve a finished root transition from the root container transitions.
- yasmin_editor.editor_gui.runtime_state.runtime_button_states(runtime_state: RuntimeViewState) dict[str, RuntimeButtonState]
Return visibility/enabled rules for the runtime control buttons.
- yasmin_editor.editor_gui.runtime_state.runtime_state_name_for_container(active_path: tuple[str, ...] | list[str] | None, current_path: tuple[str, ...] | list[str] | None) str | None
Return the active child state name visible in the current container.