From 485fad16e58ed17d308df842413dd4900a94976a Mon Sep 17 00:00:00 2001 From: Martin Gracik Date: Tue, 23 Nov 2010 12:49:02 +0100 Subject: [PATCH] Add the DataHolder class --- src/pylorax/base.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/pylorax/base.py b/src/pylorax/base.py index b4278371..d8fb712c 100644 --- a/src/pylorax/base.py +++ b/src/pylorax/base.py @@ -47,3 +47,12 @@ class BaseLoraxClass(object): def pdebug(self, msg, file=sys.stdout): self.output.debug(msg, file) + + +class DataHolder(dict): + + def __getattr__(self, attr): + return self[attr] + + def __setattr__(self, attr, value): + self[attr] = value