clean up logic; prevent a tb in Windoz

This commit is contained in:
Nikos Kouremenos 2005-12-12 14:05:01 +00:00
parent 01b248757b
commit 32fbe2729c
1 changed files with 9 additions and 9 deletions

View File

@ -32,22 +32,22 @@ _ = i18n._
try: try:
import dbus import dbus
version = getattr(dbus, 'version', (0, 20, 0)) version = getattr(dbus, 'version', (0, 20, 0))
supported = True
except ImportError: except ImportError:
version = (0, 0, 0) version = (0, 0, 0)
supported = False
if not os.name == 'nt': # only say that to non Windows users
print _('D-Bus python bindings are missing in this computer')
print _('D-Bus capabilities of Gajim cannot be used')
# dbus 0.23 leads to segfault with threads_init()
if sys.version[:4] >= '2.4' and version[1] < 30:
supported = False
if version >= (0, 41, 0): if version >= (0, 41, 0):
import dbus.service import dbus.service
import dbus.glib # cause dbus 0.35+ doesn't return signal replies without it import dbus.glib # cause dbus 0.35+ doesn't return signal replies without it
supported = True
if 'dbus' not in globals() and not os.name == 'nt':
print _('D-Bus python bindings are missing in this computer')
print _('D-Bus capabilities of Gajim cannot be used')
supported = False
# dbus 0.23 leads to segfault with threads_init()
if sys.version[:4] >= '2.4' and version[1] < 30:
supported = False
class SessionBus: class SessionBus:
'''A Singleton for the DBus SessionBus''' '''A Singleton for the DBus SessionBus'''
def __init__(self): def __init__(self):