mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 02:34:06 -04:00
cleanups
This commit is contained in:
parent
329786a07b
commit
f1bf1e4fae
@ -27,7 +27,7 @@ class Notifier(object):
|
|||||||
return timeout, body, summary
|
return timeout, body, summary
|
||||||
|
|
||||||
def __call__(self, body, summary=None, replaces_id=None, timeout=0):
|
def __call__(self, body, summary=None, replaces_id=None, timeout=0):
|
||||||
raise NotImplementedError
|
raise NotImplementedError('implement in subclass')
|
||||||
|
|
||||||
|
|
||||||
@lru_cache(maxsize=2)
|
@lru_cache(maxsize=2)
|
||||||
@ -66,7 +66,7 @@ class FDONotifier(DBUSNotifier):
|
|||||||
self._notify.Notify('calibre', replaces_id, icon(), summary, body,
|
self._notify.Notify('calibre', replaces_id, icon(), summary, body,
|
||||||
self.dbus.Array(signature='s'), self.dbus.Dictionary({"desktop-entry": "calibre-gui"}, signature='sv'),
|
self.dbus.Array(signature='s'), self.dbus.Dictionary({"desktop-entry": "calibre-gui"}, signature='sv'),
|
||||||
timeout)
|
timeout)
|
||||||
except:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ class XDPNotifier(DBUSNotifier):
|
|||||||
"body": self.dbus.String(body),
|
"body": self.dbus.String(body),
|
||||||
"icon": self.dbus.Struct(("bytes", self.dbus.ByteArray(icon(data=True), variant_level=1)), signature='sv'),
|
"icon": self.dbus.Struct(("bytes", self.dbus.ByteArray(icon(data=True), variant_level=1)), signature='sv'),
|
||||||
}, signature='sv'))
|
}, signature='sv'))
|
||||||
except:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ class QtNotifier(Notifier):
|
|||||||
finally:
|
finally:
|
||||||
if hide:
|
if hide:
|
||||||
self.systray.hide()
|
self.systray.hide()
|
||||||
except:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ class AppleNotifier(Notifier):
|
|||||||
if self.ok:
|
if self.ok:
|
||||||
try:
|
try:
|
||||||
self.notify(body, summary)
|
self.notify(body, summary)
|
||||||
except:
|
except Exception:
|
||||||
import traceback
|
import traceback
|
||||||
traceback.print_exc()
|
traceback.print_exc()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user