From d55cc5872503567775f0d7a7731d6f489bf2299b Mon Sep 17 00:00:00 2001 From: mathieui Date: Sun, 12 Nov 2017 15:03:09 +0100 Subject: yapf -ir --- poezio/tabs/muclisttab.py | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) (limited to 'poezio/tabs/muclisttab.py') diff --git a/poezio/tabs/muclisttab.py b/poezio/tabs/muclisttab.py index f14f4172..005f3fe1 100644 --- a/poezio/tabs/muclisttab.py +++ b/poezio/tabs/muclisttab.py @@ -11,6 +11,7 @@ from poezio.tabs import ListTab from slixmpp.plugins.xep_0030.stanza.items import DiscoItem + class MucListTab(ListTab): """ A tab listing rooms from a specific server, displaying various information, @@ -20,8 +21,7 @@ class MucListTab(ListTab): plugin_keys = {} def __init__(self, core, server): - ListTab.__init__(self, core, server.full, - "ā€œjā€: join room.", + ListTab.__init__(self, core, server.full, "ā€œjā€: join room.", 'Chatroom list on server %s (Loading)' % server, (('node-part', 0), ('name', 2), ('users', 3))) self.key_func['j'] = self.join_selected @@ -29,10 +29,12 @@ class MucListTab(ListTab): self.key_func['^M'] = self.join_selected def get_columns_sizes(self): - return {'node-part': int(self.width* 2 / 8), - 'name': int(self.width * 5 / 8), - 'users': self.width - int(self.width * 2 / 8) - - int(self.width * 5 / 8)} + return { + 'node-part': int(self.width * 2 / 8), + 'name': int(self.width * 5 / 8), + 'users': + self.width - int(self.width * 2 / 8) - int(self.width * 5 / 8) + } def join_selected_no_focus(self): return @@ -43,16 +45,18 @@ class MucListTab(ListTab): Used with command_list """ if iq['type'] == 'error': - self.set_error(iq['error']['type'], iq['error']['code'], iq['error']['text']) + self.set_error(iq['error']['type'], iq['error']['code'], + iq['error']['text']) return + def get_items(): substanza = iq['disco_items'] for item in substanza['substanzas']: if isinstance(item, DiscoItem): yield (item['jid'], item['node'], item['name']) - items = [(item[0].split('@')[0], - item[0], - item[2] or '', '') for item in get_items()] + + items = [(item[0].split('@')[0], item[0], item[2] or '', '') + for item in get_items()] self.listview.set_lines(items) self.info_header.message = 'Chatroom list on server %s' % self.name if self.core.current_tab() is self: @@ -67,4 +71,3 @@ class MucListTab(ListTab): if not row: return self.core.command.join(row[1]) - -- cgit v1.2.3