當前位置: 首頁>>代碼示例>>Python>>正文


Python raven.fetch_git_sha方法代碼示例

本文整理匯總了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") 
開發者ID:Steffo99,項目名稱:greed,代碼行數:32,代碼來源:worker.py

示例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') 
開發者ID:RagtagOpen,項目名稱:nomad,代碼行數:9,代碼來源:config.py

示例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) 
開發者ID:hoelsner,項目名稱:product-database,代碼行數:12,代碼來源:celery.py


注:本文中的raven.fetch_git_sha方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。