peltak.core.conf
¶
- class peltak.core.conf.Config(values=None, *, path=None)[source]¶
Represents the
pelconf.yaml
file.- get(name, *default)[source]¶
Get config value with the given name and optional default.
- Parameters
name (str) – The name of the config value.
*default (Any) – If given and the key doesn’t not exist, this will be returned instead. If it’s not given and the config value does not exist, AttributeError will be raised
- Return type
- Returns
The requested config value. This is one of the global values defined in this file. If the value does not exist it will return default if give or raise
AttributeError
.- Raises
AttributeError – If the value does not exist and default was not given.
- get_path(name, *default)[source]¶
Get config value as path relative to the project directory.
This allows easily defining the project configuration within the fabfile as always relative to that fabfile.
- Parameters
name (str) – The name of the config value containing the path.
*default (Any) – If given and the key doesn’t not exist, this will be returned instead. If it’s not given and the config value does not exist, AttributeError will be raised
- Return type
- Returns
The requested config value. This is one of the global values defined in this file. If the value does not exist it will return default if give or raise
AttributeError
.- Raises
AttributeError – If the value does not exist and default was not given.