objectstate.global_config
Generic global configuration context management.
Provides thread-local storage for global configuration state. This is used as the base context for all lazy configuration resolution.
DUAL THREAD-LOCAL PATTERN: - _saved_global_config_contexts: SAVED config (what descendants/compiler see) - _live_global_config_contexts: LIVE config (what UI sees during editing)
Default behavior: UI uses LIVE (sees unsaved edits) Explicit override: Compilation uses SAVED (via use_live_global=False)
Functions
|
Get current global config. |
|
Get LIVE global config (what UI sees during editing). |
|
Get SAVED global config (what descendants/compiler see). |
|
DEPRECATED: Use set_saved_global_config() or set_live_global_config() explicitly. |
|
Set global config for editing (sets BOTH saved and live). |
|
Set LIVE global config (what UI sees during editing). |
|
Set SAVED global config (what descendants/compiler see). |
- objectstate.global_config.set_saved_global_config(config_type: Type, config_instance: Any) None[source]
Set SAVED global config (what descendants/compiler see).
Called when: - App startup loads cached config - User SAVES GlobalPipelineConfig in ConfigWindow - Tests set up saved state
- Parameters:
config_type – The config type to set
config_instance – The SAVED config instance
- objectstate.global_config.set_live_global_config(config_type: Type, config_instance: Any) None[source]
Set LIVE global config (what UI sees during editing).
Called when: - User types in GlobalPipelineConfig field (every keystroke) - UI needs to show live preview of unsaved changes
- Parameters:
config_type – The config type to set
config_instance – The LIVE (unsaved) config instance
- objectstate.global_config.get_saved_global_config(config_type: Type) Any | None[source]
Get SAVED global config (what descendants/compiler see).
- Parameters:
config_type – The config type to retrieve
- Returns:
Saved config instance or None
- objectstate.global_config.get_live_global_config(config_type: Type) Any | None[source]
Get LIVE global config (what UI sees during editing).
- Parameters:
config_type – The config type to retrieve
- Returns:
Live config instance or None
- objectstate.global_config.set_current_global_config(config_type: Type, config_instance: Any, *, caller_context: str = None) None[source]
DEPRECATED: Use set_saved_global_config() or set_live_global_config() explicitly.
For backward compatibility, this sets BOTH saved and live.
- objectstate.global_config.set_global_config_for_editing(config_type: Type, config_instance: Any) None[source]
Set global config for editing (sets BOTH saved and live).
Use this for app startup and initial setup. For live editing updates, use set_live_global_config(). For saving, use set_saved_global_config().
- Parameters:
config_type – The config type to set
config_instance – The config instance to set
- objectstate.global_config.get_current_global_config(config_type: Type, use_live: bool = True) Any | None[source]
Get current global config.
- Parameters:
config_type – The config type to retrieve
use_live – If True (default), return LIVE config (UI sees unsaved edits). If False, return SAVED config (compiler sees saved values).
- Returns:
Config instance or None