예제 #1
0
def decode_object(d):
    if '__decode__' in d:
        return get_module_attr(d['__decode__'])(d['__data__'])
    elif '__pickled__' in d:
        return pickle.loads(str(d['__pickled__']))
    else:
        return d
예제 #2
0
def decode_object(d):
    if '__decode__' in d:
        return get_module_attr(d['__decode__'])(d['__data__'])
    elif '__pickled__' in d:
        return pickle.loads(str(d['__pickled__']))
    else:
        return d
예제 #3
0
파일: encode.py 프로젝트: fogmoon/handy
def decode_object(d):
    if '__decode__' in d:
        return get_module_attr(d['__decode__'])(d['__data__'])
    elif '__pickled__' in d:
        return safe_decode(d['__pickled__'])
    else:
        return d
예제 #4
0
def default_decode((cls, data)):
    cls = get_module_attr(cls)
    obj = cls.__new__(cls)
    obj.__dict__.update(data['__data__'])
    return obj
예제 #5
0
def default_decode((cls, data)):
    cls = get_module_attr(cls)
    obj = cls.__new__(cls)
    obj.__dict__.update(data['__data__'])
    return obj