Example #1
0
 def __init__(self, value):
     if isinstance(value, dict):
         super(DictData, self).__init__(value)
     else:
         d = data_eval.data_eval(value)
         assert isinstance(d, dict)
         super(DictData, self).__init__(d)
Example #2
0
 def __init__(self, value):
     if isinstance(value, basestring):
         self.value = value
         super(DictData, self).__init__(data_eval.data_eval(value))
     elif isinstance(value, dict):
         self.value = None
         super(DictData, self).__init__(value)
     else:
         raise TypeError("init data is not from type basestring or dict (It's type: %r)" % type(value))
Example #3
0
def deserialize(stream):
    return data_eval.data_eval(stream)