我们从Python开源项目中,提取了以下2个代码示例,用于说明如何使用raven.fetch_git_sha()。
def get_release(): import startupintro import raven from raven import exceptions as raven_exceptions release = startupintro.__version__ try: git_hash = raven.fetch_git_sha(os.path.dirname(os.pardir))[:7] release = '{}-{}'.format(release, git_hash) except raven_exceptions.InvalidGitRepository: pass return release
def RAVEN_CONFIG(self): if not hasattr(self, 'RAVEN_SECRET_KEY'): return {} return { 'dsn': 'https://{public_key}:{secret_key}@app.getsentry.com/{project_id}'.format( public_key=self.RAVEN_PUBLIC_KEY, secret_key=self.RAVEN_SECRET_KEY, project_id=self.RAVEN_PROJECT_ID ), 'release': raven.fetch_git_sha(self.TOP_DIR), } # Email