From dd3f12dfa436378ed7849cb2b9f920ac4b0d9234 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sat, 2 Dec 2023 13:13:13 -0600 Subject: [PATCH] Do not send ntfy messages when debugging While debugging `xactfetch`, I do not need it to send me notifications about failures, etc., since I am sitting at my computer. To suppress them, I can now set the `DEBUG_NTFY` environment variable to `0`. --- xactfetch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xactfetch.py b/xactfetch.py index 106bfe2..b270fdd 100644 --- a/xactfetch.py +++ b/xactfetch.py @@ -288,6 +288,8 @@ class ntfyerror: log.exception( 'Swallowed exception:', exc_info=(exc_type, exc_value, tb) ) + if os.environ.get('DEBUG_NTFY', '1') == '0': + return True if ss := self.page.screenshot(): save_screenshot(ss) ntfy(