本文整理汇总了Python中raven.fetch_git_sha方法的典型用法代码示例。如果您正苦于以下问题:Python raven.fetch_git_sha方法的具体用法?Python raven.fetch_git_sha怎么用?Python raven.fetch_git_sha使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类raven
的用法示例。
在下文中一共展示了raven.fetch_git_sha方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import raven [as 别名]
# 或者: from raven import fetch_git_sha [as 别名]
def __init__(self, bot: utils.DuckBot, chat: telegram.Chat, telegram_user: telegram.User, *args, **kwargs):
# Initialize the thread
super().__init__(name=f"Worker {chat.id}", *args, **kwargs)
# Store the bot and chat info inside the class
self.bot: utils.DuckBot = bot
self.chat: telegram.Chat = chat
self.telegram_user: telegram.User = telegram_user
# Open a new database session
log.debug(f"Opening new database session for {self.name}")
self.session = db.Session()
# Get the user db data from the users and admin tables
self.user: Optional[db.User] = None
self.admin: Optional[db.Admin] = None
# The sending pipe is stored in the Worker class, allowing the forwarding of messages to the chat process
self.queue = queuem.Queue()
# The current active invoice payload; reject all invoices with a different payload
self.invoice_payload = None
# The localization strings for this user
self.loc = None
# The Sentry client for reporting errors encountered by the user
if configloader.config["Error Reporting"]["sentry_token"] != \
"https://00000000000000000000000000000000:00000000000000000000000000000000@sentry.io/0000000":
import raven
self.sentry_client = raven.Client(configloader.config["Error Reporting"]["sentry_token"],
release=raven.fetch_git_sha(os.path.dirname(__file__)),
environment="Dev" if __debug__ else "Prod")
log.debug("Sentry: enabled")
else:
self.sentry_client = None
log.debug("Sentry: disabled")
示例2: get_git_sha
# 需要导入模块: import raven [as 别名]
# 或者: from raven import fetch_git_sha [as 别名]
def get_git_sha():
try:
return raven.fetch_git_sha(os.path.dirname(os.path.dirname(__file__)))
except Exception as e:
print(e)
pass
return os.environ.get('HEROKU_SLUG_COMMIT')
示例3: on_configure
# 需要导入模块: import raven [as 别名]
# 或者: from raven import fetch_git_sha [as 别名]
def on_configure(self):
if settings.PDB_SENTRY_DSN: # ignore for coverage
client = raven.Client(settings.PDB_SENTRY_DSN)
client.release = raven.fetch_git_sha(os.path.dirname(os.pardir))
# register a custom filter to filter out duplicate logs
register_logger_signal(client)
# hook into the Celery error handler
register_signal(client)