Settings
- class gpype.common.settings._Settings[source]
Bases:
dictSingleton settings manager for g.Pype application configuration.
Manages persistent settings stored in XML format in platform-specific directories. Provides automatic type conversion, default values, and thread-safe singleton access.
Storage locations: - Windows: %PROGRAMDATA%/gtec/gPype/settings.xml - macOS: ~/Library/Application Support/gtec/gPype/settings.xml - elsewhere: $XDG_CONFIG_HOME (or ~/.config)/gtec/gPype/settings.xml
Where that directory cannot be determined or created – Android, with no usable home – the temp directory’s gtec/gPype is used instead, and where that fails too the settings live in memory only (
file_pathis None). Either is announced once, with a RuntimeWarning naming the file used or saying the settings will not persist. An explicitGPYPE_SETTINGS_DIRis never replaced.Use Settings.get() to access the singleton instance.
- DEFAULTS = {'Key': ''}
Default settings applied on first initialization
- __init__()[source]
Initialize the settings singleton instance.
Loads existing settings from XML file, applies default values for missing keys, and saves the updated configuration.
- Raises:
RuntimeError – If an instance already exists. Use get() instead.