Config
Main configuration module.
- CONFIG_FILE_DEFINITION: tuple[str, str] = ('command-line-assistant', 'config.toml')
Define the config file path.
- class Config(database=<factory>, history=<factory>, backend=<factory>, logging=<factory>)[source]
Class that holds our configuration file representation.
With this class, after being initialized, one can access their fields like:
>>> config = Config() >>> config.output.enforce_script
- database
Match the
py:DatabaseSchemaclass and their fields- Type:
DatabaseSchema
- history
Match the
py:HistorySchemaclass and their fields- Type:
HistorySchema
- backend
Match the
py:BackendSchemaclass and their fields- Type:
BackendSchema
- logging
Match the
py:LoggingSchemaclass and their fields- Type:
LoggingSchema
-
backend:
BackendSchema
-
database:
DatabaseSchema
-
history:
HistorySchema
-
logging:
LoggingSchema
- load_config_file()[source]
Load the configuration file from the system.
- Return type:
Config- Raises:
FileNotFoundError – In case the configuration file is missing
tomllib.TOMLDecodeError – In case it is not possible to decode the config file
- Returns:
An instance of the configuration file
- Return type:
Config