From 76528decda9ebbd132d25d3b09e6bd644c4a432e Mon Sep 17 00:00:00 2001 From: bartool Date: Fri, 6 Mar 2026 19:20:32 +0100 Subject: [PATCH] feat: add notifier.py for windows notifications --- notifier.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 notifier.py diff --git a/notifier.py b/notifier.py new file mode 100644 index 0000000..252460c --- /dev/null +++ b/notifier.py @@ -0,0 +1,26 @@ +from logger import logger + +try: + from plyer import notification + PLYER_AVAILABLE = True +except ImportError: + logger.warning("plyer not found. Notifications will be printed to stdout.") + PLYER_AVAILABLE = False + +class Notifier: + def notify(self, title, message): + logger.info(f"Notification: {title} - {message}") + if PLYER_AVAILABLE: + try: + notification.notify( + title=title, + message=message, + app_name="Git Monitor", + # timeout=10 + ) + except Exception as e: + logger.error(f"Error showing notification: {e}") + else: + print(f"[{title}] {message}") + +notifier = Notifier()