diff options
author | rcoh <rcoh@mit.edu> | 2011-02-08 18:47:17 -0500 |
---|---|---|
committer | rcoh <rcoh@mit.edu> | 2011-02-08 18:47:17 -0500 |
commit | 03d08792f437e1ce93dc0cbfa997025029c8e74e (patch) | |
tree | 0f4b5a63317bc582c2ab760b7339a709b7445afb /operationscore | |
parent | 9cf7747d70032cee28f29f9707360544a0e63277 (diff) | |
parent | 06c639db6b98affab4abf07e57a90e2fcb5402ef (diff) |
Merge branch 'configimprovements' into objprops
Diffstat (limited to 'operationscore')
-rw-r--r-- | operationscore/SmootCoreObject.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py index 0d32773..51b84e3 100644 --- a/operationscore/SmootCoreObject.py +++ b/operationscore/SmootCoreObject.py @@ -2,6 +2,7 @@ import pdb import threading import thread import util.Config as configGetter +import types class SmootCoreObject(object): """SmootCoreObject is essentially a super-object class which grants us some niceties. It allows @@ -34,9 +35,13 @@ class SmootCoreObject(object): def __setitem__(self,k, item): self.argDict[k] = item - def __getitem__(self, item): - if item in self.argDict: - return self.argDict[item] + def __getitem__(self, key): + if key in self.argDict: + item = self.argDict[key] + if isinstance(item, types.FunctionType): + return item(self.argDict) #resolve the lambda function, if it exists + else: + return item else: return None def __contains__(self, item): |