settings_manager module

core.settings_manager.CONFIG_VERSION = 1

The current configuration version. Used for migration.

core.settings_manager.DEFAULT_SETTINGS = {'default_cols': 25, 'default_rows': 25, 'grid_size': 50, 'grid_type': 'square', 'last_profile_used': None, 'recent_files': [], 'theme': 'light'}

Default settings for the application.

class core.settings_manager.SettingsManager(path='config/settings.json')

Bases: object

Manages application settings, including loading, saving, and migrating configuration files.

Parameters:

path (str) – Path to the settings JSON file.

get(key, default=None)

Get a setting value.

Parameters:
  • key (str) – The setting key.

  • default (Any) – The default value if the key is not found.

Returns:

The value of the setting or default.

save_settings()

Save the current settings to the configuration file.

set(key, value)

Set a setting value and save the configuration.

Parameters:
  • key (str) – The setting key.

  • value (Any) – The value to set.