conf_engine.configuration¶
Attributes¶
Classes¶
Module Contents¶
- conf_engine.configuration.REGISTERED_PARSERS¶
- class conf_engine.configuration.ConfigGroup(name: str | None, namespace: str = None, cache: bool = True)¶
- _name¶
- _namespace = None¶
- _cache = True¶
- _opt_cache¶
- _value_cache¶
- __getattr__(item: str)¶
- __contains__(item)¶
- _get_option(option: str)¶
- _cache_option_value(name, value)¶
- _get_option_value_from_cache(name)¶
- _option_value_cached(name)¶
- _get_option_value(option: conf_engine.options.Option, group)¶
- _get_option_value_from_source(option: conf_engine.options.Option, group)¶
- flush_cache(name: str = None)¶
Flush the value cache and read from configuration source on next access. :param name: If name is provided, only the value for the named option is flushed. :return:
- register_options(options: [conf_engine.options.Option])¶
- register_option(option: conf_engine.options.Option)¶
- class conf_engine.configuration.Configuration(namespace: str = None, cache: bool = True)¶
- _cache = True¶
- _group_cache¶
- _namespace = None¶
- __getattr__(item)¶
- __contains__(item)¶
- register_options(options: [conf_engine.options.Option], group: str = None)¶
Register bulk options with the config. :param options: List of options. :param group: Group name to which options are added. :return:
- flush_cache()¶
Signal all configuration groups to flush their cache and read from configuration source on next access.
- register_option(option: conf_engine.options.Option, group: str = None, create_group: bool = True)¶
Register options with the config. If group is specified, the options are added to the option group, otherwise options are registered to the base object. :param option: Option to register. :param group: Group name to which the option is added. :param create_group: Create the group if not already registered. :return:
- property registered_parsers¶
- _get_group(group: str)¶
Get group by its name as called during attribute access against the configuration object. If the option cannot be found an UnregisteredOption error will be raised.
If the option matches a group name, the group object is returned and the subsequent attribute access is handled by the group object.