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 ########
#####################################
评论列表
文章目录