libera_utils.config#
Configuration reader. To modify the configuration, see file: config.json
Module Attributes
Singleton (one per process) accessor for |
Classes
Customize the string formatter to replace fields in a config string with values from the configuration dictionary. |
- class libera_utils.config.ConfigurationFormatter#
Customize the string formatter to replace fields in a config string with values from the configuration dictionary. This will allow configuration parameters in the emus_config.json file to be based off of other configuration parameters by wrapping the configuration key in curly braces.
Methods
get_field
(field_name, args, kwargs)get_value
(key, *args, **kwargs)Overrides the default get_value method in the python formatter.
parse
(format_string)check_unused_args
convert_field
format
format_field
vformat
- class libera_utils.config._ConfigurationCache#
Class that stores the JSON configuration and provides methods for accessing configuration information
Methods
Force reloading of the JSON config
get
(key)Retrieves a configuration value from either the cached JSON or from the environment
- _format_return_value(value: str)#
Recursively formats the returned value, looking for config keys to substitute.
- _parse_numeric_types(value: str)#
Checks the final result of a config retrieval. If it is a string that can be interpreted as a float or int, parse it and return that.
- force_reload()#
Force reloading of the JSON config
- libera_utils.config.config = <libera_utils.config._ConfigurationCache object>#
Singleton (one per process) accessor for
libera_utils.config._ConfigurationCache()