# HG changeset patch # User Goffi # Date 1530512531 -7200 # Node ID ab523cc967bb6cbaab365bf842e3f95fcd7df956 # Parent e702228b655a22567df1b816dbc3cf9591fa19d6 core(notification): display a warning and disable notifications if something is going wrong diff -r e702228b655a -r ab523cc967bb cagou/core/cagou_main.py --- a/cagou/core/cagou_main.py Fri Jun 29 16:14:09 2018 +0200 +++ b/cagou/core/cagou_main.py Mon Jul 02 08:22:11 2018 +0200 @@ -818,8 +818,14 @@ def desktop_notif(self, message, title=u'', duration=5000): if notification is not None: - notification.notify(title=title, - message=message, - app_name=C.APP_NAME, - app_icon=self.app.icon, - timeout = duration) + try: + notification.notify(title=title, + message=message, + app_name=C.APP_NAME, + app_icon=self.app.icon, + timeout = duration) + except Exception as e: + log.warning(_(u"Can't use notifications, disabling: {msg}").format( + msg = e)) + global notification + notification = None