def generate_help_text():
 def generate_cmds_with_explanations(summary, cmds):
  text = '{0}:\n'.format(summary)
  for (cmd, explanation) in cmds:
   text += ' DCTB {0:<10} DCTB {1:<20}\n'.format(cmd, explanation)
  return (text + '\n')
 text = generate_cmds_with_explanations('Commands', ROOT_COMMANDS.items())
 text += generate_cmds_with_explanations('Options', OPTION_NAMES.items())
 text += generate_cmds_with_explanations('Actions', ACTIONS.items())
 text += generate_cmds_with_explanations('Headers', HEADER_NAMES.items())
 return text

def generate_help_text ( ) : def generate_cmds_with_explanations ( summary , cmds ) : text = '{0}:\n' . format ( summary ) for ( cmd , explanation ) in cmds : text += ' DCTB {0:<10} DCTB {1:<20}\n' . format ( cmd , explanation ) return ( text + '\n' ) text = generate_cmds_with_explanations ( 'Commands' , ROOT_COMMANDS . items ( ) ) text += generate_cmds_with_explanations ( 'Options' , OPTION_NAMES . items ( ) ) text += generate_cmds_with_explanations ( 'Actions' , ACTIONS . items ( ) ) text += generate_cmds_with_explanations ( 'Headers' , HEADER_NAMES . items ( ) ) return text
return a formatted string listing commands .