comparison src/plugins/plugin_misc_text_commands.py @ 929:059b56cbd247

plugin text commands: commands are now sorted in /help
author Goffi <goffi@goffi.org>
date Mon, 24 Mar 2014 15:18:53 +0100
parents 73873e9b56f7
children 301b342c697a
comparison
equal deleted inserted replaced
928:73873e9b56f7 929:059b56cbd247
203 """show help on available commands""" 203 """show help on available commands"""
204 commands = filter(lambda method: method.startswith('cmd_'), dir(self)) 204 commands = filter(lambda method: method.startswith('cmd_'), dir(self))
205 longuest = max([len(command) for command in commands]) 205 longuest = max([len(command) for command in commands])
206 help_cmds = [] 206 help_cmds = []
207 207
208 for command in self._commands: 208 for command in sorted(self._commands):
209 method = self._commands[command] 209 method = self._commands[command]
210 try: 210 try:
211 help_str = method.__doc__.split('\n')[0] 211 help_str = method.__doc__.split('\n')[0]
212 except AttributeError: 212 except AttributeError:
213 help_str = '' 213 help_str = ''