check session and system bus before supposing dbus is working. Fixes #5628

This commit is contained in:
Yann Leboulanger 2010-02-25 15:33:27 +01:00
parent 407c9a2975
commit dd2ee07826

View file

@ -42,6 +42,7 @@ except ImportError:
else: else:
try: try:
# test if dbus-x11 is installed # test if dbus-x11 is installed
bus = dbus.SystemBus()
bus = dbus.SessionBus() bus = dbus.SessionBus()
supported = True # does user have D-Bus bindings? supported = True # does user have D-Bus bindings?
except dbus.DBusException: except dbus.DBusException:
@ -49,6 +50,12 @@ else:
if not os.name == 'nt': # only say that to non Windows users if not os.name == 'nt': # only say that to non Windows users
print _('D-Bus does not run correctly on this machine') print _('D-Bus does not run correctly on this machine')
print _('D-Bus capabilities of Gajim cannot be used') print _('D-Bus capabilities of Gajim cannot be used')
except exceptions.SystemBusNotPresent:
print _('D-Bus does not run correctly on this machine: system bus not '
'present')
except exceptions.SessionBusNotPresent:
print _('D-Bus does not run correctly on this machine: session bus not '
'present')
class SystemBus: class SystemBus:
""" """