Settings

class gpype.common.settings._Settings[source]

Bases: dict

Singleton 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

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.

static get()[source]

Get the singleton settings instance.

Creates the instance if it doesn’t exist, otherwise returns the existing instance.

Returns:

The singleton settings instance.

Return type:

_Settings

write()[source]

Write current settings to the XML file with pretty formatting.