visiomode.config.Config¶
- class visiomode.config.Config(path='/etc/visiomode/config.yaml')¶
Bases:
YamlAttributesMixin
Configuration class for visiomode components.
Defaults to development settings unless initialised with a valid path to a config YAML, or the file specified by DEFAULT_PATH exists.
- __init__(path='/etc/visiomode/config.yaml')¶
Initialises Config with a path to a configuration file.
If a valid configuration file exists, the program assumes it is NOT in debug mode, unless the config file specifies otherwise.
- Parameters
path – Path to config YAML, defaults to DEFAULT_PATH. Only used if it exists.
Methods
__init__
([path])Initialises Config with a path to a configuration file.
load_yaml
(path)Loads YAML file parameters as class attributes.
save_yaml
(path[, exclude])Save class attributes as a YAML file.
Attributes
data_dir
debug
devices
flask_key
fps
fullscreen
height
width
- __init__(path='/etc/visiomode/config.yaml')¶
Initialises Config with a path to a configuration file.
If a valid configuration file exists, the program assumes it is NOT in debug mode, unless the config file specifies otherwise.
- Parameters
path – Path to config YAML, defaults to DEFAULT_PATH. Only used if it exists.
- load_yaml(path)¶
Loads YAML file parameters as class attributes.
- Parameters
path – Path to config YAML.
- save_yaml(path, exclude=None)¶
Save class attributes as a YAML file.