예제 #1
0
def from_bytes(bytes_data, setters, exclude):
    msg = msgpack.loads(bytes_data, encoding='utf8')
    for key, setter in setters.items():
        if key not in exclude and key in msg:
            setter(msg[key])
    return msg
예제 #2
0
def from_bytes(bytes_data, setters, exclude):
    msg = msgpack.loads(bytes_data, raw=False)
    for key, setter in setters.items():
        if key not in exclude and key in msg:
            setter(msg[key])
    return msg