__init__.py 283 字节
Newer Older
C
ceci3 已提交
1 2 3 4 5 6 7 8 9
def encode_config(config):
    return '_'.join([str(c) for c in config['channels']])


def decode_config(config_str):
    channels = config_str.split('_')
    assert len(channels) == 6 or len(channels) == 8
    channels = [int(c) for c in channels]
    return {'channels': channels}