utils.py 文件源码

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

项目:verse 作者: pawelad 项目源码 文件源码
def deconstruct_github_url(url):
    """
    Helper function for deconstructing GitHub repository URL and returning its
    owner and name

    :param url: GitHub repository URL
    :type url: str
    :returns: repository owner and name
    :rtype: tuple
    """
    if not url.startswith(GITHUB_PREFIX):
        raise ValueError(
            "Passed URL is not a GitHub repository: {}".format(url)
        )

    owner, repo = remove_prefix(url, GITHUB_PREFIX).split('/')[:2]

    return owner, repo
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号