github.py 文件源码

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

项目:django-chartwerk 作者: DallasMorningNews 项目源码 文件源码
def commit_script(path, script):
    """Commit script string to GitHub repo."""
    repository = get_repository()

    try:
        sha = repository.get_contents(path).sha
        repository.update_file(
            path=path,
            message='Template update',
            content=script,
            sha=sha
        )
    except GithubException:
        repository.create_file(
            path=path,
            message='Template initial commit',
            content=script
        )
        logging.info("Initial commit of new file {}".format(path))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号