Allow DataHolder to have initial values

This commit is contained in:
Martin Gracik 2010-11-23 13:19:36 +01:00
parent 33286629b5
commit e9eea0f3ea
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,12 @@ class BaseLoraxClass(object):
class DataHolder(dict):
def __init__(self, **kwargs):
dict.__init__(self)
for attr, value in kwargs.items():
self[attr] = value
def __getattr__(self, attr):
return self[attr]