utils.py 文件源码

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

项目:vulnerability-rating-taxonomy 作者: bugcrowd 项目源码 文件源码
def all_versions(filename):
    """
    Find, open and parse all tagged versions of a json file, including the current version

    :param filename: The filename to find
    :return: a dictionary of all the versions, in the form
        {
            'current': {...},
            '1.0': {...},
            '1.1': {...}
        }
    """
    repo = git.Repo()
    versions = {
        'current': get_json(filename)
    }
    for tag in repo.tags:
        version_dict = repo.git.show('%s:%s' % (tag.name, filename))
        versions[tag.name.strip('v')] = json.loads(version_dict)
    return versions
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号