githubskill.py 文件源码

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

项目:skill-for-github 作者: dkavanagh 项目源码 文件源码
def get_orgs(intent, session):
    session_attributes = {}
    reprompt_text = None
    should_end_session = True

    g = Github(session['user']['accessToken'])
    orgs = g.get_user().get_orgs()
    num_orgs = 0
    org_strings = []
    for org in orgs:
        num_orgs += 1
        org_strings.append(org.url[org.url.rfind('/')+1:])
    if num_orgs > 0:
        speech_output = \
            'You belong to these organizations. ' + ','.join(org_strings)
    else:
        speech_output = "You don't have any organizations in this account."

    return build_response(session_attributes, build_speechlet_response(
        intent['name'], speech_output, reprompt_text, should_end_session))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号