def treatDict(self, obj, raw): listItems = raw['items'] from TuningTools.PreProc import PreProcCollection tObj = type(obj) for idx, cObj in enumerate(listItems): if hasattr( cObj, 'toRawObj' ): listItems[idx] = cObj.toRawObj() RawDictStreamer.treatDict( self, obj, raw ) return raw
def __call__(self, obj): "Return a raw dict object from itself" setattr(obj,'items', list(obj)) self._logger.debug("Added property items to %s with the following list: %r", obj.__class__.__name__, obj.__dict__['items']) raw = RawDictStreamer.__call__( self, obj ) obj.__dict__.pop('items') return raw