summaryrefslogtreecommitdiff
path: root/poezio/tabs/muclisttab.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2017-11-12 15:03:09 +0100
committermathieui <mathieui@mathieui.net>2017-11-12 15:03:09 +0100
commitd55cc5872503567775f0d7a7731d6f489bf2299b (patch)
tree725f9e7b8144d36054447b3c82edfb45bda8df1d /poezio/tabs/muclisttab.py
parent92496db823db34f7f7fb1ab31eaef093a707c3e8 (diff)
downloadpoezio-d55cc5872503567775f0d7a7731d6f489bf2299b.tar.gz
poezio-d55cc5872503567775f0d7a7731d6f489bf2299b.tar.bz2
poezio-d55cc5872503567775f0d7a7731d6f489bf2299b.tar.xz
poezio-d55cc5872503567775f0d7a7731d6f489bf2299b.zip
yapf -ir
Diffstat (limited to 'poezio/tabs/muclisttab.py')
-rw-r--r--poezio/tabs/muclisttab.py25
1 files changed, 14 insertions, 11 deletions
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])
-