Add public Config.set_storage() method.
authorW. Trevor King <wking@drexel.edu>
Thu, 8 Sep 2011 21:37:59 +0000 (17:37 -0400)
committerW. Trevor King <wking@drexel.edu>
Thu, 8 Sep 2011 21:37:59 +0000 (17:37 -0400)
h5config/config.py
h5config/storage/__init__.py

index 8d8317420b2411ee6429aa035c04104db44965c7..2814fa4bd60692652b7896861cbc1a06b6de5e52 100644 (file)
@@ -251,11 +251,14 @@ class Config (dict):
     def __init__(self, storage=None):
         super(Config, self).__init__()
         self.clear()
-        self._storage = storage
+        self.set_storage(storage=storage)
 
     def __repr__(self):
         return '<{} {}>'.format(self.__class__.__name__, id(self))
 
+    def set_storage(self, storage):
+        self._storage = storage
+
     def clear(self):
         super(Config, self).clear()
         for s in self.settings:
index b9d72e58ffdc43a7ef387fee632298b5f85a24f5..428e98ebb886b4b6358368880d36595ee1541463 100644 (file)
@@ -22,7 +22,7 @@ class Storage (object):
         if merge:
             self.clear()
         self._load(config=config, **kwargs)
-        config._storage = self
+        config.set_storage(storage=self)
 
     def _load(self, config, **kwargs):
         raise NotImplementedError()