reorder: group exception handling
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
This commit is contained in:
parent
496752d0db
commit
da695768b0
1 changed files with 14 additions and 17 deletions
|
@ -167,9 +167,6 @@ class Plugin(BasePlugin):
|
|||
cls, jid = tabs_spec[pos]
|
||||
try:
|
||||
jid = JID(jid)
|
||||
except InvalidJID:
|
||||
self.api.information('Reorder: Invalid JID \'%s\'.' % jid, 'Warning')
|
||||
continue
|
||||
tab = self.core.tabs.by_name_and_class(str(jid), cls=cls)
|
||||
if tab and tab in old_tabs:
|
||||
new_tabs.append(tab)
|
||||
|
@ -178,13 +175,13 @@ class Plugin(BasePlugin):
|
|||
self.api.information('Tab %s not found. Creating it' % jid, 'Warning')
|
||||
# TODO: Add support for MucTab. Requires nickname.
|
||||
if cls in (tabs.DynamicConversationTab, tabs.StaticConversationTab):
|
||||
try:
|
||||
new_tab = cls(self.core, jid)
|
||||
new_tabs.append(new_tab)
|
||||
except:
|
||||
self.api.information('Failed to create tab \'%s\'.' % jid, 'Error')
|
||||
if create_gaps:
|
||||
new_tabs.append(tabs.GapTab(self.core))
|
||||
finally:
|
||||
last = pos
|
||||
|
||||
for tab in old_tabs:
|
||||
|
|
Loading…
Reference in a new issue