appsettings.py¶
Application settings manager.
-
class
clay.settings.
_Settings
[source]¶ Settings management class.
-
__weakref__
¶ list of weak references to the object (if defined)
-
_commit_edits
(config)[source]¶ Write config to file.
This method is supposed to be called only from
__exit__()
.
-
edit
()[source]¶ Return
_SettingsEditor
context manager to edit config.Settings are saved to file once the returned context manager exists.
Example usage:
from clay.settings import settings with settings.edit() as config: config['foo']['bar'] = 'baz'
-
get
(key, *sections)[source]¶ Return their configuration key in a specified section By default it looks in play_settings.
-
get_default_config_section
(*sections)[source]¶ Always get a section from the default/system configuration. You would use this whenever you need to loop through all the values in a section. In the user config they might be incomplete.
-
-
class
clay.settings.
_SettingsEditor
(original_config, commit_callback)[source]¶ Thread-safe settings editor context manager.
For example see
edit()
.-
__init__
(original_config, commit_callback)[source]¶ x.__init__(…) initializes x; see help(type(x)) for signature
-
__weakref__
¶ list of weak references to the object (if defined)
-