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
1 changed files with 7 additions and 0 deletions

View File

@ -42,6 +42,7 @@ except ImportError:
else:
try:
# test if dbus-x11 is installed
bus = dbus.SystemBus()
bus = dbus.SessionBus()
supported = True # does user have D-Bus bindings?
except dbus.DBusException:
@ -49,6 +50,12 @@ else:
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 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:
"""