make sure we use dbus public api so we work for python dbus 0.80; see #2784

This commit is contained in:
Nikos Kouremenos 2006-12-17 11:43:34 +00:00
parent 2aab2688f7
commit 6faf04a056
4 changed files with 12 additions and 10 deletions

View File

@ -55,7 +55,7 @@ class SystemBus:
if self.system_bus is None:
try:
self.system_bus = dbus.SystemBus()
except dbus.dbus_bindings.DBusException:
except dbus.DBusException:
self.system_bus = None
return False
if self.system_bus is None:
@ -86,7 +86,7 @@ class SessionBus:
if self.session_bus is None:
try:
self.session_bus = dbus.SessionBus()
except dbus.dbus_bindings.DBusException:
except dbus.DBusException:
self.session_bus = None
return False
if self.session_bus is None:

View File

@ -248,7 +248,7 @@ class Zeroconf:
return True
except dbus.dbus_bindings.DBusException, e:
except dbus.DBusException, e:
gajim.log.debug(str(e))
return False
@ -279,7 +279,7 @@ class Zeroconf:
return True
else:
return False
except dbus.dbus_bindings.DBusException, e:
except dbus.DBusException, e:
gajim.log.debug("Can't remove service. That should not happen")
def browse_domain(self, interface, protocol, domain):

View File

@ -114,9 +114,12 @@ class MusicTrackListener(gobject.GObject):
bus = dbus.SessionBus()
if not hasattr(bus, 'name_has_owner'):
print 'You need dbus-python >= 0.80' #FIXME: translate me or RM me for .12
return None
## Check Muine playing track
if dbus.dbus_bindings.bus_name_has_owner(bus.get_connection(),
'org.gnome.Muine'):
if bus.name_has_owner('org.gnome.Muine'):
obj = bus.get_object('org.gnome.Muine', '/org/gnome/Muine/Player')
player = dbus.Interface(obj, 'org.gnome.Muine.Player')
if player.GetPlaying():
@ -126,8 +129,7 @@ class MusicTrackListener(gobject.GObject):
return song
## Check Rhythmbox playing song
if dbus.dbus_bindings.bus_name_has_owner(bus.get_connection(),
'org.gnome.Rhythmbox'):
if bus.name_has_owner('org.gnome.Rhythmbox'):
rbshellobj = bus.get_object('org.gnome.Rhythmbox',
'/org/gnome/Rhythmbox/Shell')
player = dbus.Interface(

View File

@ -288,7 +288,7 @@ def popup(event_type, jid, account, msg_type = '', path_to_image = None,
DesktopNotification(event_type, jid, account, msg_type,
path_to_image, title, text)
return # sucessfully did D-Bus Notification procedure!
except dbus.dbus_bindings.DBusException, e:
except dbus.DBusException, e:
# Connection to D-Bus failed
gajim.log.debug(str(e))
except TypeError, e:
@ -438,7 +438,7 @@ class DesktopNotification:
self.notif = dbus_support.get_notifications_interface()
if self.notif is None:
raise dbus.dbus_bindings.DBusException()
raise dbus.DBusException('unable to get notifications interface')
self.ntype = ntype
self.get_version()