leads.config.template#
Module Contents#
Classes#
API#
- class leads.config.template.ConfigTemplate(base: dict[str, leads.types.SupportedConfig])[source]#
Bases:
leads.data.SerializableInitialization
All custom attributes should be public (not named after β_β). Writable attributes should start with βw_β such as βw_debug_levelβ. :param base: the base dictionary
- fix_dict(d: dict[str, Any]) dict[str, leads.types.SupportedConfig][source]#
Fix the types of every element in the dictionary. :param d: the input dictionary :return: the fixed dictionary
- fix_type(value: Any) leads.types.SupportedConfig[source]#
Replace lists with tuples and check for illegal types. :param value: the input value :return: the fixed value where :exception TypeError: the type of the value is illegal
- _writable(name: str) bool[source]#
- Parameters:
name β the configuration name
- Returns:
True: writable; False: readonly
- set(name: str, value: leads.types.SupportedConfig) None[source]#
Set the value with the given name in the dictionary. :param name: the dictionary key :param value: the value to set
- get(name: str, default: leads.types.SupportedConfig | None = None) leads.types.SupportedConfig | None[source]#
Get the value of a given name from the dictionary. :param name: the dictionary key :param default: the default value if the value does not exist :return: the value if it exists or else the default value