Table of Contents

Class: HelpFormatter ./src/peak/util/optparse.py

Abstract base class for formatting option help. OptionParser instances should use one of the HelpFormatter subclasses for formatting help; by default IndentedHelpFormatter is used.

Instance attributes: parser : OptionParser the controlling OptionParser instance indent_increment : int the number of columns to indent per nesting level max_help_position : int the maximum starting column for option help text help_position : int the calculated starting column for option help text; initially the same as the maximum width : int total number of columns for output (pass None to constructor for this value to be taken from the $COLUMNS environment variable) level : int current indentation level current_indent : int current indentation level (in columns) help_width : int number of columns available for option help text (calculated) default_tag : str text to replace with each option's default value, "%default" by default. Set to false value to disable default value expansion. option_strings : { Option : str } maps Option instances to the snippet of help text explaining the syntax of that option, e.g. "-h, --help" or "-fFILE, --file=FILE" _short_opt_fmt : str format string controlling how short options with values are printed in help text. Must be either "%s%s" ("-fFILE") or "%s %s" ("-f FILE"), because those are the two syntaxes that Optik supports. _long_opt_fmt : str similar but for long options; must be either "%s %s" ("--file FILE") or "%s=%s" ("--file=FILE").

Methods   
__init__
dedent
expand_default
format_description
format_heading
format_option
format_option_strings
format_usage
indent
set_long_opt_delimiter
set_parser
set_short_opt_delimiter
store_option_strings
  __init__ 
__init__ (
        self,
        indent_increment,
        max_help_position,
        width,
        short_first,
        )

  dedent 
dedent ( self )

  expand_default 
expand_default ( self,  option )

  format_description 
format_description ( self,  description )

  format_heading 
format_heading ( self,  heading )

Exceptions   
NotImplementedError, "subclasses must implement"
  format_option 
format_option ( self,  option )

  format_option_strings 
format_option_strings ( self,  option )

Return a comma-separated list of option strings & metavariables.

  format_usage 
format_usage ( self,  usage )

Exceptions   
NotImplementedError, "subclasses must implement"
  indent 
indent ( self )

  set_long_opt_delimiter 
set_long_opt_delimiter ( self,  delim )

Exceptions   
ValueError( "invalid metavar delimiter for long options: %r" % delim )
  set_parser 
set_parser ( self,  parser )

  set_short_opt_delimiter 
set_short_opt_delimiter ( self,  delim )

Exceptions   
ValueError( "invalid metavar delimiter for short options: %r" % delim )
  store_option_strings 
store_option_strings ( self,  parser )


Table of Contents

This document was automatically generated on Mon Apr 15 01:11:04 2024 by HappyDoc version 2.1