diff options
Diffstat (limited to 'operationscore/SmootCoreObject.py')
-rw-r--r-- | operationscore/SmootCoreObject.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/operationscore/SmootCoreObject.py b/operationscore/SmootCoreObject.py index 0d32773..6addb9c 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,15 @@ 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 + #elif isinstance(item, list): #if its a list of items + # pass #TODO: consider doing resolution of lambda funcs for items in lists + else: + return item else: return None def __contains__(self, item): |