Output debug info about searching for DBUS notifiers on linux

This commit is contained in:
Kovid Goyal 2017-10-20 10:50:01 +05:30
parent bfa209a1b7
commit def1417d22
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -7,7 +7,9 @@ __copyright__ = '2009, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en' __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): class Notifier(object):
@ -31,6 +33,9 @@ class DBUSNotifier(Notifier):
def __init__(self, server, path, interface): def __init__(self, server, path, interface):
self.ok, self.err = True, None self.ok, self.err = True, None
if DEBUG:
start = time.time()
prints('Looking for desktop notifier support from:', server)
try: try:
import dbus import dbus
self.dbus = dbus self.dbus = dbus
@ -38,6 +43,8 @@ class DBUSNotifier(Notifier):
except Exception as err: except Exception as err:
self.ok = False self.ok = False
self.err = str(err) self.err = str(err)
if DEBUG:
prints(server, 'found' if self.ok else 'not found', 'in', '%.1f' % (time.time() - start), 'seconds')
class KDENotifier(DBUSNotifier): class KDENotifier(DBUSNotifier):