conf_engine.configuration
¶
Module Contents¶
Classes¶
Attributes¶
- conf_engine.configuration.REGISTERED_PARSERS¶
- class conf_engine.configuration.ConfigGroup(name: Union[str, None], namespace: str = None, cache: bool = True)¶
- __getattr__(self, item: str)¶
- __contains__(self, item)¶
- _get_option(self, option: str)¶
- _cache_option_value(self, name, value)¶
- _get_option_value_from_cache(self, name)¶
- _option_value_cached(self, name)¶
- _get_option_value(self, option: conf_engine.options.Option, group)¶
- _get_option_value_from_source(self, option: conf_engine.options.Option, group)¶
- flush_cache(self, 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(self, options: [conf_engine.options.Option])¶
- register_option(self, option: conf_engine.options.Option)¶
- class conf_engine.configuration.Configuration(namespace: str = None, cache: bool = True)¶
- __getattr__(self, item)¶
- __contains__(self, item)¶
- register_options(self, 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(self)¶
Signal all configuration groups to flush their cache and read from configuration source on next access.
- register_option(self, 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(self)¶
- _get_group(self, 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.