本文整理匯總了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)