#NEWLINE# def _commands_help( self ) : #NEWLINE# #INDENT# commands = ( [ name for name in self . commands ] + [ 'help' ] ) #NEWLINE# max_len = len ( max ( commands , key = len ) ) #NEWLINE# output = [ 'Commands' , ' ' ] #NEWLINE# for name in commands : #NEWLINE# #INDENT# if ( name == 'help' ) : #NEWLINE# #INDENT# desc = 'Get help on a command' #NEWLINE# output . append ( ( '    %-*s\t%s' % ( max_len , name , desc ) ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# cmd = self . commands [ name ] #NEWLINE# output . append ( ( '    %-*s\t%s' % ( max_len , name , cmd . short_descr ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# output . append ( '' ) #NEWLINE# return '\n' . join ( output )