From b26378d5a5f4a0937cf6f4043c4af3071a664a7a Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 8 Sep 2011 17:37:59 -0400 Subject: [PATCH] Add public Config.set_storage() method. --- h5config/config.py | 5 ++++- h5config/storage/__init__.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/h5config/config.py b/h5config/config.py index 8d83174..2814fa4 100644 --- a/h5config/config.py +++ b/h5config/config.py @@ -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: diff --git a/h5config/storage/__init__.py b/h5config/storage/__init__.py index b9d72e5..428e98e 100644 --- a/h5config/storage/__init__.py +++ b/h5config/storage/__init__.py @@ -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() -- 2.26.2