leads.config.registry#
Module Contents#
Functions#
Set the root node of the callback chain that is triggered when a configuration is registered. :param callback: the callback interface |
|
Load a configuration from a file. :param file: the file to load from :param constructor: the constructor or an equivalent function :return: the configuration |
|
Register a configuration. :param config: the configuration :exception RuntimeError: duplicated registration |
|
Get the registered configuration. :return: the configuration if registered or else None |
|
Require the registered configuration. :return: the configuration :exception RuntimeError: no configuration is registered |
Data#
API#
- leads.config.registry.T = '_TypeVar(...)'#
- leads.config.registry._config_instance: leads.config.registry.T | None = None#
- leads.config.registry._on_register_config: leads.types.OnRegister[leads.config.registry.T] = None[source]#
- leads.config.registry.set_on_register_config(callback: leads.types.OnRegisterChain[leads.config.registry.T]) None[source]#
Set the root node of the callback chain that is triggered when a configuration is registered. :param callback: the callback interface
- leads.config.registry.load_config(file: str | TextIO, constructor: Callable[[dict[str, leads.types.SupportedConfig]], leads.config.registry.T]) leads.config.registry.T[source]#
Load a configuration from a file. :param file: the file to load from :param constructor: the constructor or an equivalent function :return: the configuration
- leads.config.registry.register_config(config: leads.config.registry.T) None[source]#
Register a configuration. :param config: the configuration :exception RuntimeError: duplicated registration