feat(notify): notify-py + _notification.py Wrapper
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
"""Desktop-Benachrichtigungen via notify-py."""
|
||||
import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
_APP_NAME = "whisper-local"
|
||||
|
||||
|
||||
def notify(title: str, message: str) -> None:
|
||||
"""Zeigt eine Desktop-Benachrichtigung. Bei Fehler wird nur geloggt."""
|
||||
try:
|
||||
from notifypy import Notify
|
||||
n = Notify()
|
||||
n.application_name = _APP_NAME
|
||||
n.title = title
|
||||
n.message = message
|
||||
n.send()
|
||||
except Exception:
|
||||
logger.warning("Benachrichtigung fehlgeschlagen: %s – %s", title, message)
|
||||
Reference in New Issue
Block a user