def toJson(obj): try: obj = IConfigured(obj).getConfigDict() except TypeError: # this happens for old style classes (not deriving objects) pass if isinstance(obj, dict): return obj # don't leak object memory address obj = obj.__class__.__module__ + "." + obj.__class__.__name__ return repr(obj) + " not yet IConfigured"
def toJson(obj): obj = IConfigured(obj).getConfigDict() if isinstance(obj, dict): return obj return repr(obj) + " not yet IConfigured"
def getConfigDict(self): return [IConfigured(e).getConfigDict() for e in self.value]
def getConfigDict(self): return dict([(k, IConfigured(v).getConfigDict()) for k, v in iteritems(self.value)])
def getConfigDict(self): return {k: IConfigured(v).getConfigDict() for k, v in self.value.items()}