diff options
author | Martin Sivak <msivak@redhat.com> | 2010-09-14 11:26:50 +0200 |
---|---|---|
committer | Martin Sivak <msivak@redhat.com> | 2010-09-14 11:26:50 +0200 |
commit | 8d5a9dbee2b3dcff179c6f4ee60013b41676b035 (patch) | |
tree | df276dfa2acbaa335d017718ae166f328d6960d1 | |
parent | 8d6a4bdb5ecd4f66223e8c6aec8ef1575ee9eb10 (diff) | |
download | firstaidkit-8d5a9dbee2b3dcff179c6f4ee60013b41676b035.tar.gz firstaidkit-8d5a9dbee2b3dcff179c6f4ee60013b41676b035.tar.xz firstaidkit-8d5a9dbee2b3dcff179c6f4ee60013b41676b035.zip |
Make result reset work
-rw-r--r-- | pyfirstaidkit/configuration.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/pyfirstaidkit/configuration.py b/pyfirstaidkit/configuration.py index 5b8a8ed..554e5e3 100644 --- a/pyfirstaidkit/configuration.py +++ b/pyfirstaidkit/configuration.py @@ -187,7 +187,7 @@ class FAKInfo(ConfigParser.SafeConfigParser, FAKConfigMixIn): ConfigParser.SafeConfigParser.__init__(self, *args, **kwargs) FAKConfigMixIn.__init__(self) self._attachments = [] - + def write(self, fd=sys.stdout): fd.write("--- Result files ---\n") for f,fas in self._attachments: @@ -210,11 +210,20 @@ class FAKInfo(ConfigParser.SafeConfigParser, FAKConfigMixIn): saveas = file self._attachments.append((file, saveas)) -Info = FAKInfo() +class InfoProxy(object): + __slots__ = ["_obj"] + + def __init__(self, obj): + self._obj = obj + + def __getattr__(self, name): + return getattr(self._obj, name) + +Info = InfoProxy(FAKInfo()) Info.lock() def resetInfo(): global Info - Info = FAKInfo() + Info._obj = FAKInfo() Info.lock() |