yasmin_editor.editor_gui.state_properties_logic module

Qt-free helpers for the state-properties dialog.

The dialog is one of the editor’s most form-heavy widgets and historically mixed user-interface code with formatting and normalization rules. These helpers keep the display-text, plugin-list, outcome, and remapping rules in a single testable module so the dialog itself can stay focused on Qt widgets.

yasmin_editor.editor_gui.state_properties_logic.build_description_text(plugin_info: yasmin_plugins_manager.plugin_info.PluginInfo | None, fallback_description: str = '', fallback_outcomes: Sequence[str] | None = None, fallback_parameters: Sequence[Dict[str, str]] | None = None, fallback_input_keys: Sequence[Dict[str, str]] | None = None, fallback_output_keys: Sequence[Dict[str, str]] | None = None) str

Build the read-only description text shown in the dialog.

The dialog can either describe a plugin-backed state or a container/fallback configuration without a plugin instance.

yasmin_editor.editor_gui.state_properties_logic.collect_parameter_overwrites(rows: Iterable[Dict[str, str]]) List[Dict[str, str]]

Return normalized overwrite rows with incomplete entries removed.

yasmin_editor.editor_gui.state_properties_logic.collect_remappings(remapping_rows: Iterable[Tuple[str, str]]) Dict[str, str]

Return the normalized remapping map from table-like row values.

yasmin_editor.editor_gui.state_properties_logic.declared_state_parameters(plugin_info: yasmin_plugins_manager.plugin_info.PluginInfo | None, fallback_parameters: Sequence[Dict[str, str]] | None = None) List[Dict[str, str]]

Return the parameter declarations visible to the dialog.

Plugin-backed states expose declarations through plugin metadata. Container dialogs and fallback cases reuse the explicit fallback rows instead.

yasmin_editor.editor_gui.state_properties_logic.format_key_line(key_info: Dict[str, str], is_input: bool) str

Return one formatted input/output key line for the description panel.

yasmin_editor.editor_gui.state_properties_logic.format_parameter_line(parameter_info: Dict[str, str]) str

Return one formatted parameter line for the description panel.

yasmin_editor.editor_gui.state_properties_logic.normalize_display_type(type_name: str) str

Return a stable user-facing type string.

The plugin manager exposes a C++ metadata normalization helper. The dialog should use it when available but remain resilient when metadata is partial or malformed.

yasmin_editor.editor_gui.state_properties_logic.normalize_parameter_overwrite_row(parameter_data: Dict[str, str]) Dict[str, str]

Return one stable parameter-overwrite row dictionary.

yasmin_editor.editor_gui.state_properties_logic.plugin_display_name(plugin: yasmin_plugins_manager.plugin_info.PluginInfo) str

Return the dialog label for one plugin entry.

yasmin_editor.editor_gui.state_properties_logic.plugin_entries_for_type(available_plugins: Sequence[yasmin_plugins_manager.plugin_info.PluginInfo], plugin_type: str) List[Tuple[str, yasmin_plugins_manager.plugin_info.PluginInfo]]

Return display-name/plugin tuples for one type selector value.

yasmin_editor.editor_gui.state_properties_logic.resolve_outcomes(plugin_info: yasmin_plugins_manager.plugin_info.PluginInfo | None, fallback_outcomes: Sequence[str]) List[str]

Return the outcome list used by the dialog result payload.