Skip to content

Custom key configer

CustomKeyConfiger

Bases: Configer

Use to manage user secret key.

Source code in agentuniverse/base/config/custom_configer/custom_key_configer.py
Python
@singleton
class CustomKeyConfiger(Configer):
    """Use to manage user secret key."""
    def __init__(self, config_path: str = None):
        self._Configer__value = {}
        super().__init__(config_path)
        if config_path:
            self.load()
        if self._Configer__value.get("KEY_LIST"):
            for key, value in self._Configer__value.get("KEY_LIST").items():
                os.environ[key] = str(value)