From 9152f128e7bfb420708f81948c1fc4c01a27a72b Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sun, 15 May 2005 11:47:15 +0000 Subject: [PATCH] fixing a traceback with disco menuitem see http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html for more --- src/config.py | 1 + src/roster_window.py | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/config.py b/src/config.py index 3c5fe69ff..37fba2332 100644 --- a/src/config.py +++ b/src/config.py @@ -1600,6 +1600,7 @@ class Service_discovery_window: self.agent_infos = {} if gajim.connections[account].connected < 2: dialogs.Error_dialog(_('You must be connected to browse services')) + raise RuntimeError, 'You must be connected to browse services' return xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP) self.window = xml.get_widget('service_discovery_window') diff --git a/src/roster_window.py b/src/roster_window.py index ee23ada8f..aa1eb512c 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1174,8 +1174,12 @@ class Roster_window: if self.plugin.windows[account].has_key('disco'): self.plugin.windows[account]['disco'].window.present() else: - self.plugin.windows[account]['disco'] = \ - config.Service_discovery_window(self.plugin, account) + try: + self.plugin.windows[account]['disco'] = \ + config.Service_discovery_window(self.plugin, account) + except RuntimeError: + pass + def load_iconset(self, path): imgs = {}