From 3780993fd8cf204924de4d38a0b34a2a59bfe3bc Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Mon, 31 Jan 2022 16:54:36 +1100 Subject: [PATCH] remove some notifs --- components/notifiers.py | 2 +- components/watchers.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/notifiers.py b/components/notifiers.py index c5b454c..ea042b4 100644 --- a/components/notifiers.py +++ b/components/notifiers.py @@ -10,7 +10,7 @@ class Notifier(ABC): class TermuxNotifier(Notifier): def notify(self, title, content, *args, **kwargs): - subprocess.call(['termux-notification', '--title', title, '--content', content]) + subprocess.call(['termux-notification', '--title', title, '--content', content or 'No Message']) class NotifySendNotifier(Notifier): diff --git a/components/watchers.py b/components/watchers.py index 7ad5dbf..ad5445c 100644 --- a/components/watchers.py +++ b/components/watchers.py @@ -35,12 +35,12 @@ class RecentWatcher(Watcher): def connect(): logging.debug(f'Live posts client connected') client.emit('room', f'{board}-manage-recent-hashed' if board else 'globalmanage-recent-hashed') - notify(f'Connected', f'Watching live posts') + #notify(f'Connected', f'Watching live posts') @client.event def disconnect(): logging.error(f'Live posts client disconnected') - notify(f'Lost live posts connection', f'Retrying in {reconnection_delay} seconds') + #notify(f'Lost live posts connection', f'Retrying in {reconnection_delay} seconds') @client.on('newPost') def on_new_post(post): @@ -88,7 +88,7 @@ class ReportsWatcher(Watcher): except RequestException as e: logging.error(f'Exception {e} occurred while fetching reports') - self.notify(f'Error while fetching reports', f'Trying to reconnect') + #self.notify(f'Error while fetching reports', f'Trying to reconnect') if self._stp.wait(self.fetch_interval): logging.info("Exiting reports watcher")