fixing a traceback with disco menuitem

see http://nkour.blogspot.com/2005/05/pythons-init-return-none-doesnt-return.html for more
This commit is contained in:
Nikos Kouremenos 2005-05-15 11:47:15 +00:00
parent 0d4084ead7
commit 9152f128e7
2 changed files with 7 additions and 2 deletions

View File

@ -1600,6 +1600,7 @@ class Service_discovery_window:
self.agent_infos = {} self.agent_infos = {}
if gajim.connections[account].connected < 2: if gajim.connections[account].connected < 2:
dialogs.Error_dialog(_('You must be connected to browse services')) dialogs.Error_dialog(_('You must be connected to browse services'))
raise RuntimeError, 'You must be connected to browse services'
return return
xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP) xml = gtk.glade.XML(GTKGUI_GLADE, 'service_discovery_window', APP)
self.window = xml.get_widget('service_discovery_window') self.window = xml.get_widget('service_discovery_window')

View File

@ -1174,8 +1174,12 @@ class Roster_window:
if self.plugin.windows[account].has_key('disco'): if self.plugin.windows[account].has_key('disco'):
self.plugin.windows[account]['disco'].window.present() self.plugin.windows[account]['disco'].window.present()
else: else:
try:
self.plugin.windows[account]['disco'] = \ self.plugin.windows[account]['disco'] = \
config.Service_discovery_window(self.plugin, account) config.Service_discovery_window(self.plugin, account)
except RuntimeError:
pass
def load_iconset(self, path): def load_iconset(self, path):
imgs = {} imgs = {}