Snakemine configuration (snakemine.conf)¶
A settings manager inspired by Django’s.
There are two ways to set user-specific settings:
- Create a module with all of the settings in it and point snakemine to the
module via the
SNAKEMINE_SETTINGS_MODULEenvironment variable. - Use
Settings.configureto set the values via its keyword arguments.
Module author: Mark Lee <snakemine@lazymalevolence.com>
-
class
snakemine.conf.Settings(default_settings)[source]¶ Bases:
objectSettings object for
snakemine.Parameters: default_settings (dict) – The default settings. A copy of this parameter is stored in the created object. -
configure(default_settings=None, **kwargs)[source]¶ Manually configures the user settings instead of via the import module method. This method can only be called if the object has not already had user settings set.
Parameters: default_settings (dict) – The default settings, which will override the default settings passed in at object creation.
-
configured¶ Whether the user settings have been set for the object.
Return type: bool
-