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/adhoc_commands_list.py | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'poezio/tabs/adhoc_commands_list.py') diff --git a/poezio/tabs/adhoc_commands_list.py b/poezio/tabs/adhoc_commands_list.py index 6db654c9..a1b186be 100644 --- a/poezio/tabs/adhoc_commands_list.py +++ b/poezio/tabs/adhoc_commands_list.py @@ -11,42 +11,51 @@ from poezio.tabs import ListTab from slixmpp.plugins.xep_0030.stanza.items import DiscoItem + class AdhocCommandsListTab(ListTab): plugin_commands = {} plugin_keys = {} def __init__(self, core, jid): - ListTab.__init__(self, core, jid.full, - "“Enter”: execute selected command.", - 'Ad-hoc commands of JID %s (Loading)' % jid, - (('Node', 0), ('Description', 1))) + ListTab.__init__( + self, core, jid.full, "“Enter”: execute selected command.", + 'Ad-hoc commands of JID %s (Loading)' % jid, (('Node', 0), + ('Description', 1))) self.key_func['^M'] = self.execute_selected_command def execute_selected_command(self): if not self.listview or not self.listview.get_selected_row(): return node, name, jid = self.listview.get_selected_row() - session = {'next': self.core.handler.next_adhoc_step, - 'error': self.core.handler.adhoc_error} + session = { + 'next': self.core.handler.next_adhoc_step, + 'error': self.core.handler.adhoc_error + } self.core.xmpp.plugin['xep_0050'].start_command(jid, node, session) def get_columns_sizes(self): - return {'Node': int(self.width * 3 / 8), - 'Description': int(self.width * 5 / 8)} + return { + 'Node': int(self.width * 3 / 8), + 'Description': int(self.width * 5 / 8) + } def on_list_received(self, iq): """ Fill the listview with the value from the received iq """ 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 - items = [(item['node'], item['name'] or '', item['jid']) for item in get_items()] + + items = [(item['node'], item['name'] or '', item['jid']) + for item in get_items()] self.listview.set_lines(items) self.info_header.message = 'Ad-hoc commands of JID %s' % self.name if self.core.current_tab() is self: -- cgit v1.2.3