From 662cb785dca41fc4e223d4f011c3e95d7f8fa72a Mon Sep 17 00:00:00 2001 From: Inso <insomniak.fr@gmail.com> Date: Sun, 6 Sep 2015 17:25:23 +0200 Subject: [PATCH] Use basic toast if notify2 is unavailable --- src/cutecoin/gui/toast.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/cutecoin/gui/toast.py b/src/cutecoin/gui/toast.py index afd30d77..8dd5ecc3 100644 --- a/src/cutecoin/gui/toast.py +++ b/src/cutecoin/gui/toast.py @@ -16,12 +16,16 @@ window = None # global def display(title, msg): logging.debug("NOTIFY DISPLAY") if sys.platform == "linux": - import notify2 - if not notify2.is_initted(): - logging.debug("Initialising notify2") - notify2.init("cutecoin") - n = notify2.Notification(title, - msg) + try: + import notify2 + if not notify2.is_initted(): + logging.debug("Initialising notify2") + notify2.init("cutecoin") + n = notify2.Notification(title, + msg) + except ImportError: + _Toast(title, msg) + # fixme: https://bugs.python.org/issue11587 # # Not working... Empty icon at the moment. -- GitLab