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:
if merge:
self.clear()
self._load(config=config, **kwargs)
- config._storage = self
+ config.set_storage(storage=self)
def _load(self, config, **kwargs):
raise NotImplementedError()