ws.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:web_ctp 作者: molebot 项目源码 文件源码
def set_accounts(_acc):
    f = shelve.open(STORE)
    _out = {}
    for k,v in _acc.items():
        _out[k] = v
        if '#' in v['instrument']:
            _out[k]['instrument'] = '#'
        elif '@' in v['instrument']:
            _out[k]['instrument'] = '@'
        else:
            _instrument = v['instrument'].split('+')
            _instrument.sort(reverse=True)
            if '' in _instrument:
                _pos = _instrument.index('')
                _instrument = _instrument[:_pos]
            _list = []
            for one in _instrument:
                if '=' in one:
                    one = filter(lambda x:x in _chars+_CHARS,one)+'='
                    _list.append(one)
                else:
                    _list.append(one)
            _out[k]['instrument'] = '+'.join(_list)
    f['accounts'] = _out
    f.close()
    start_accounts(get_accounts())
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号