forked from platypush/platypush
Added a Config.set
method.
A useful interface to change configuration values at runtime.
This commit is contained in:
parent
dd862db29a
commit
77ffefdccb
1 changed files with 11 additions and 0 deletions
|
@ -483,5 +483,16 @@ class Config:
|
|||
return config.get(key, default)
|
||||
return config
|
||||
|
||||
@classmethod
|
||||
def set(cls, key: str, value: Any):
|
||||
"""
|
||||
Set a config value.
|
||||
|
||||
:param key: Configuration entry to set.
|
||||
:param value: New value to set.
|
||||
"""
|
||||
# pylint: disable=protected-access
|
||||
cls._get_instance()._config[key] = value
|
||||
|
||||
|
||||
# vim:sw=4:ts=4:et:
|
||||
|
|
Loading…
Reference in a new issue