commit_status.py 文件源码

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

项目:githubtools 作者: nricklin 项目源码 文件源码
def main(argv=None, test=False):
    arguments = docopt(__doc__, argv=argv)
    status = arguments['--status']
    commit = arguments['--commit-hash']
    user = arguments['--username']
    password = arguments['--password']
    token = arguments['--token']
    url = arguments['--url']
    repo = arguments['--repo']
    context = arguments['--context']
    description = arguments['--description']
    print "Setting status %s for commit %s." % (status, commit)

    if token:
        g = Github(token)
    elif user and password:
        g = Github(user,password)
    r = g.get_repo(repo)
    c = r.get_commit(commit)
    s = c.create_status(status, target_url=url, description=description, context=context)

    if test:
        return s
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号