spines.config¶
Spines configuration subpackage
-
class
spines.config.
Config
(*args, **kwargs)[source]¶ Bases:
spines.config.base.BaseConfig
Primary configuration class for spines.
-
add_plugin
(plugin: Union[str, spines.config.core.PluginConfig], update: bool = False) → None[source]¶ Adds a plugin configuration to this config object
- Parameters
plugin (
str
orPluginConfig
) – Plugin to add to this configuration.update (bool, optional) – Whether or not to update the existing plugin configuration with the new one or to replace it (default is
False
, replace).
-
plugins
¶ Plugin configurations in this configuration.
- Type
dict
-
-
spines.config.
get_config
(setting: str = _MISSING, default: Any = _MISSING) → spines.config.core.Config[source]¶ Get the global spines configuration
- Parameters
setting (str, optional) – Setting(s) to get from the global configuration.
default (optional) – Value to return if setting is not set (if not given an error will occur if accessing a non-existant setting).
- Returns
The global configuration settings for the current spines project or the values for the settings given.
- Return type
Config
ordict
- Raises
ValueError – If the given setting(s) doesn’t exist and no default value is provided.
-
spines.config.
load_config
(*path, update: bool = False) → None[source]¶ Loads the global spines configuration
- Parameters
path (
str
(or multiple), optional) – File(s) to load the configuration from (defaults to the correct spines hierarchy for configuration files).update (bool, optional) – Update the current configuration as opposed to replacing it with the newly loaded on (default is
False
, replace it).
-
class
spines.config.
PluginConfig
(name: str, *args, **kwargs)[source]¶ Bases:
spines.config.base.BaseConfig
Plugin configuration class for spines.
-
name
¶ Name of the plugin this configuration is for.
- Type
str
-