Config
Configure application.
- class Config(args: bool = True, config_file: str = '/home/bertin/.config/visiomatic/visiomatic.conf')[source]
Bases:
object
Manage application settings in groups.
Settings are stored as Pydantic fields.
- grouped_dict() dict [source]
Return a dictionary of all settings, organized in groups.
- Returns:
gdict (dict) -- Dictionary of settings.
- flat_dict() dict [source]
Return a flattened dictionary of all settings.
- Returns:
fdict (dict) -- Dictionary of settings.
- schema() dict [source]
Return a schema of the settings as a dictionary.
- Returns:
schema (dict) -- Schema of the settings, as a dictionary.
- schema_json(indent=2) str [source]
Return a schema of the settings as a JSON string.
- Parameters:
indent (int) -- Number of indentation spaces.
- Returns:
schema (str) -- JSON schema of the settings.
- parse_args() dict [source]
Return a dictionary of all settings, with values updated from the command line.
Extra settings are ignored.
- Returns:
gdict (dict) -- Dictionary of all settings, organized in groups.
- parse_config(filename: str) dict [source]
Return a dictionary of all settings, with values updated from a configuration file in INI format.
Extra settings are ignored.