remote.py 文件源码

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

项目:guides-cms 作者: pluralsight 项目源码 文件源码
def commit_image_to_github(path, message, file_, name, email, sha=None,
                           branch=u'master'):
    """
    Save given image file content to github

    :param path: Path to file (<owner>/<repo>/<dir>/.../<filename>)
    :param message: Commit message to save file with
    :param file_: Open file object
    :param name: Name of author who wrote file
    :param email: Email address of author
    :param sha: Optional SHA of file if it already exists on github
    :param branch: Name of branch to commit file to (branch must already
                   exist)

    :returns: SHA of commit or None for failure
    """

    contents = base64.encodestring(file_.read())
    return commit_file_to_github(path, message, contents, name, email, sha=sha,
                                 branch=branch, auto_encode=False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号