aboutsummaryrefslogtreecommitdiffstats
path: root/conf/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'conf/__init__.py')
-rw-r--r--conf/__init__.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/conf/__init__.py b/conf/__init__.py
index 808cfc97..a7c0ee5d 100644
--- a/conf/__init__.py
+++ b/conf/__init__.py
@@ -189,6 +189,18 @@ class Settings(object):
else:
setattr(self, key.upper(), conf[key])
+ def restore_from_dict(self, conf):
+ """
+ Restore ``settings`` with values found in ``conf``.
+
+ Method will drop all configuration options and restore their
+ values from conf dictionary
+ """
+ self.__dict__.clear()
+ tmp_conf = copy.deepcopy(conf)
+ for key in tmp_conf:
+ self.setValue(key, tmp_conf[key])
+
def load_from_env(self):
"""
Update ``settings`` with values found in the environment.