From def1417d227da4af97383b2cf144e648c08f52bb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 20 Oct 2017 10:50:01 +0530 Subject: [PATCH] Output debug info about searching for DBUS notifiers on linux --- src/calibre/gui2/notify.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/calibre/gui2/notify.py b/src/calibre/gui2/notify.py index 8768957866..143464875b 100644 --- a/src/calibre/gui2/notify.py +++ b/src/calibre/gui2/notify.py @@ -7,7 +7,9 @@ __copyright__ = '2009, Kovid Goyal ' __docformat__ = 'restructuredtext en' -from calibre.constants import islinux, isosx, get_osx_version +import time +from calibre import prints +from calibre.constants import islinux, isosx, get_osx_version, DEBUG class Notifier(object): @@ -31,6 +33,9 @@ class DBUSNotifier(Notifier): def __init__(self, server, path, interface): self.ok, self.err = True, None + if DEBUG: + start = time.time() + prints('Looking for desktop notifier support from:', server) try: import dbus self.dbus = dbus @@ -38,6 +43,8 @@ class DBUSNotifier(Notifier): except Exception as err: self.ok = False self.err = str(err) + if DEBUG: + prints(server, 'found' if self.ok else 'not found', 'in', '%.1f' % (time.time() - start), 'seconds') class KDENotifier(DBUSNotifier):