bootstrap_editorial.py 文件源码

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

项目:editolido 作者: flyingeek 项目源码 文件源码
def infos_from_giturl(url):
    """
    retrieve the tag or branch from the URL parameter of the action
    :param url: The URL parameter of the action
    :return: tag or branch
    """
    pattern = re.compile(
        r'/(?P<owner>[^/]+)/(?P<name>[^/]+)/archive/(?P<tag>[^/]+)\.zip')
    m = pattern.search(url)
    if m:
        d = m.groupdict()
        if is_branch(d['tag']):
            d['branch'] = d['tag']
            d['version'] = None
            d['branch_release'] = d['tag']
        else:
            d['branch'] = 'master'
            d['branch_release'] = False
            d['version'] = StrictVersion(d['tag'])
    else:
        d = dict(owner=None, name=None, tag=None,
                 branch=None, branch_release=None, version=None)
    return d
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号