From 965e2b1c78337e73ddd4086bd3541ae3f7e2b2be Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Fri, 29 Jun 2007 22:25:50 +0000 Subject: [PATCH] don't try to do Awn code if it's not available --- src/roster_window.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/roster_window.py b/src/roster_window.py index 53bfd4e6a..550e8c9fa 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -3538,6 +3538,13 @@ class RosterWindow: if not dbus_support.supported: # do nothing if user doesn't have D-Bus bindings return + bus = dbus.SessionBus() + try: + if not 'com.google.code.Awn' in bus.list_names(): + # Awn is not installed + return + except: + pass iconset = gajim.config.get('iconset') prefix = os.path.join(gajim.DATA_DIR, 'iconsets', iconset, '32x32') if status in ('chat', 'away', 'xa', 'dnd', 'invisible', 'offline'): @@ -3547,7 +3554,6 @@ class RosterWindow: status = 'gajim.png' path = os.path.join(prefix, status) try: - bus = dbus.SessionBus() obj = bus.get_object('com.google.code.Awn', '/com/google/code/Awn') awn = dbus.Interface(obj, 'com.google.code.Awn') awn.SetTaskIconByName('Gajim', os.path.abspath(path))