mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Output debug info about searching for DBUS notifiers on linux
This commit is contained in:
parent
bfa209a1b7
commit
def1417d22
@ -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):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user