articles.py 文件源码

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

项目:pilot-elife 作者: frictionlessdata 项目源码 文件源码
def _get_files(owner, repo, sha, tokens):
    """Get repo file paths
    """
    # TODO: use other tokens if first fails
    github_api = GitHub(token=tokens[0])
    repo_api = github_api.repository(owner, repo)
    # First attempt - use GitHub Tree API
    files = _get_files_tree_api(repo_api, sha)
    if files is None:
        # Tree is trancated - use GitHub Contents API
        files = _get_files_contents_api(repo_api, sha)
    log.debug(
        'Remaining GitHub API calls: %s',
        github_api.rate_limit()['rate']['remaining'])
    return files
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号