toot.py 文件源码

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

项目:tootstream 作者: magicalraccoon 项目源码 文件源码
def completion_add(toot):
    """Add usernames (original author, mentions, booster) co completion_list"""
    if toot['reblog']:
        username = '@' + toot['reblog']['account']['acct']
        if username not in completion_list:
            bisect.insort(completion_list, username)
    username = '@' + toot['account']['acct']
    if username not in completion_list:
        bisect.insort(completion_list, username)
    for user in ['@' + user['acct'] for user in toot['mentions']]:
        if user not in completion_list:
            bisect.insort(completion_list, username)

#####################################
######## CONFIG FUNCTIONS    ########
#####################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号