diff options
author | Florent Le Coz <louiz@louiz.org> | 2014-05-04 20:44:10 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2014-05-04 21:05:47 +0200 |
commit | d78b7df68b452bd81af153e285224fc568962af4 (patch) | |
tree | 5f6a5e22651231a087308e0d78f9aa686141c775 /src/tabs/adhoc_commands_list.py | |
parent | bbc55fa40eaaed6bb57fddd2e9cc5eb1d3baa8cc (diff) | |
download | poezio-d78b7df68b452bd81af153e285224fc568962af4.tar.gz poezio-d78b7df68b452bd81af153e285224fc568962af4.tar.bz2 poezio-d78b7df68b452bd81af153e285224fc568962af4.tar.xz poezio-d78b7df68b452bd81af153e285224fc568962af4.zip |
Implement the execution of ad-hoc commands (#1832)
Diffstat (limited to 'src/tabs/adhoc_commands_list.py')
-rw-r--r-- | src/tabs/adhoc_commands_list.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/tabs/adhoc_commands_list.py b/src/tabs/adhoc_commands_list.py index d0504677..76cd941a 100644 --- a/src/tabs/adhoc_commands_list.py +++ b/src/tabs/adhoc_commands_list.py @@ -25,12 +25,14 @@ class AdhocCommandsListTab(ListTab): self.key_func['^M'] = self.execute_selected_command def execute_selected_command(self): - row = self.listview.get_selected_row() - log.debug("Executing command %s", row) + node, name, jid = self.listview.get_selected_row() + session = {'next': self.core.on_next_adhoc_step, + 'error': self.core.on_adhoc_error} + self.core.xmpp.plugin['xep_0050'].start_command(jid, node, session) def get_columns_sizes(self): - return {'Node': int(self.width * 2 / 8), - 'Description': int(self.width * 6 / 8)} + return {'Node': int(self.width * 3 / 8), + 'Description': int(self.width * 5 / 8)} def on_list_received(self, iq): """ @@ -39,14 +41,12 @@ class AdhocCommandsListTab(ListTab): if iq['type'] == 'error': self.set_error(iq['error']['type'], iq['error']['code'], iq['error']['text']) return - log.debug("iq: %s", iq) 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()] - log.debug(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: |