git_extras.py 文件源码

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

项目:network-monitoring 作者: rubienr 项目源码 文件源码
def render(self, context):
        try:
            r = Repo(BASE_DIR)
            version = r.rev_parse("HEAD").hexsha
            context['git'] = {
                "shortHexSha": version[0:7],
                "hexSha": version,
                "shortRemote": "https://github.com",
                "remote": "https://github.com/rubienr/network-monitoring"
            }
        except Exception:
            context['git'] = {
                "shortHexSha": None,
                "hexSha": None,
                "shortRemote": None,
                "remote": None,
            }
        return ""
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号