From 7b5997156b603b775c6fa2b4aa897aab8ddb6437 Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Sat, 27 Aug 2005 13:35:11 +0000 Subject: [PATCH] [stephan]use for-else statement (one less var used) --- src/roster_window.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/roster_window.py b/src/roster_window.py index 9da59bbab..81c743527 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -1732,7 +1732,6 @@ _('If "%s" accepts this request you will know his status.') %jid) config.ServiceDiscoveryWindow(self.plugin, account) except RuntimeError: pass - def load_iconset(self, path): imgs = {} @@ -2002,13 +2001,11 @@ _('If "%s" accepts this request you will know his status.') %jid) if model.iter_n_children(iter_group_source) == 1: #this was the only child model.remove(iter_group_source) #delete the group if it is empty (need to look for offline users too) - group_empty = True for jid in gajim.contacts[account]: - if grp_source in gajim.contacts[account][jid][0].groups: - group_empty = False + if group in gajim.contacts[account][jid][0].groups: break - if group_empty: - del gajim.groups[account][grp_source] + else: + del gajim.groups[account][group] if not grp_dest in u.groups: u.groups.append(grp_dest) self.add_contact_to_roster(data, account)