qmi.core.config
Read and process configuration files.
The QMI configuration file language closely resembles JSON. The configuration language differs from JSON as follows:
The top-level value in the file must be a dictionary (the JSON specification calls this an object).
Comments are allowed (and ignored during reading).
Comments start with
#and continue until the end of the line.Comments can not be placed inside strings.
Functions
|
Reject duplicate keys. |
|
Write configuration data to a file. |
|
Serialize configuration data to a string. |
|
Load configuration data from a file. |
Load configuration data from a string. |
- qmi.core.config.config_pairs_hook(config_pairs) OrderedDict
Reject duplicate keys.
- qmi.core.config.load_config_string(s: str) dict
Load configuration data from a string.
- Parameters:
s – String containing configuration data.
- Returns:
Parsed configuration data checked for duplicates.
- qmi.core.config.load_config_file(filename: str) dict
Load configuration data from a file.
- Parameters:
filename – Path of configuration file.
- Returns:
Parsed configuration data.
- qmi.core.config.dump_config_string(cfg: dict) str
Serialize configuration data to a string.
- Parameters:
cfg – Configuration data.
- Returns:
Serialized configuration string.
- qmi.core.config.dump_config_file(cfg: dict, filename: str) None
Write configuration data to a file.
- Parameters:
cfg – Configuration data.
filename – Path of configuration file to write.