CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Private Member Functions
argparse.ArgumentDefaultsHelpFormatter Class Reference
Inheritance diagram for argparse.ArgumentDefaultsHelpFormatter:
argparse.HelpFormatter argparse.HelpFormatter

Private Member Functions

def _get_help_string
 
def _get_help_string
 

Additional Inherited Members

- Public Member Functions inherited from argparse.HelpFormatter
def __init__
 
def __init__
 
def add_argument
 
def add_argument
 
def add_arguments
 
def add_arguments
 
def add_text
 
def add_text
 
def add_usage
 
def add_usage
 
def end_section
 
def end_section
 
def format_help
 
def format_help
 
def start_section
 
def start_section
 

Detailed Description

Help message formatter which adds default values to argument help.

Only the name of this class is considered a public API. All the methods
provided by the class are considered an implementation detail.

Definition at line 649 of file argparse.py.

Member Function Documentation

def argparse.ArgumentDefaultsHelpFormatter._get_help_string (   self,
  action 
)
private

Definition at line 656 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter._expand_help(), and argparse.ArgumentDefaultsHelpFormatter._get_help_string().

657  def _get_help_string(self, action):
658  help = action.help
659  if '%(default)' not in action.help:
660  if action.default is not SUPPRESS:
661  defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
662  if action.option_strings or action.nargs in defaulting_nargs:
663  help += ' (default: %(default)s)'
664  return help
665 
666 
667 # =====================
668 # Options and Arguments
669 # =====================
def argparse.ArgumentDefaultsHelpFormatter._get_help_string (   self,
  action 
)
private

Definition at line 673 of file argparse.py.

References argparse._get_action_name(), argparse.ArgumentDefaultsHelpFormatter._get_help_string(), and join().

674  def _get_help_string(self, action):
675  help = action.help
676  if '%(default)' not in action.help:
677  if action.default is not SUPPRESS:
678  defaulting_nargs = [OPTIONAL, ZERO_OR_MORE]
679  if action.option_strings or action.nargs in defaulting_nargs:
680  help += ' (default: %(default)s)'
681  return help
682 
683 
684 # =====================
685 # Options and Arguments
686 # =====================