CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
argparse.HelpFormatter Class Reference
Inheritance diagram for argparse.HelpFormatter:
argparse.ArgumentDefaultsHelpFormatter argparse.RawDescriptionHelpFormatter argparse.RawTextHelpFormatter

Classes

class  _Section
 

Public Member Functions

def __init__ (self, prog, indent_increment=2, max_help_position=24, width=None)
 
def add_argument (self, action)
 
def add_arguments (self, actions)
 
def add_text (self, text)
 
def add_usage (self, usage, actions, groups, prefix=None)
 
def end_section (self)
 
def format_help (self)
 
def start_section (self, heading)
 

Private Member Functions

def _add_item (self, func, args)
 
def _dedent (self)
 
def _expand_help (self, action)
 
def _fill_text (self, text, width, indent)
 
def _format_action (self, action)
 
def _format_action_invocation (self, action)
 
def _format_actions_usage (self, actions, groups)
 
def _format_args (self, action, default_metavar)
 
def _format_text (self, text)
 
def _format_usage (self, usage, actions, groups, prefix)
 
def _get_help_string (self, action)
 
def _indent (self)
 
def _iter_indented_subactions (self, action)
 
def _join_parts (self, part_strings)
 
def _metavar_formatter (self, action, default_metavar)
 
def _split_lines (self, text, width)
 

Private Attributes

 _action_max_length
 
 _current_indent
 
 _current_section
 
 _indent_increment
 
 _level
 
 _long_break_matcher
 
 _max_help_position
 
 _prog
 
 _root_section
 
 _whitespace_matcher
 
 _width
 

Detailed Description

Formatter for generating usage messages and argument help strings.

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 177 of file argparse.py.

Constructor & Destructor Documentation

def argparse.HelpFormatter.__init__ (   self,
  prog,
  indent_increment = 2,
  max_help_position = 24,
  width = None 
)

Definition at line 188 of file argparse.py.

References createfilelist.int.

188  width=None):
189 
190  # default setting for width
191  if width is None:
192  try:
193  width = int(_os.environ['COLUMNS'])
194  except (KeyError, ValueError):
195  width = 80
196  width -= 2
197 
198  self._prog = prog
199  self._indent_increment = indent_increment
200  self._max_help_position = max_help_position
201  self._width = width
202 
204  self._level = 0
206 
207  self._root_section = self._Section(self, None)
209 
210  self._whitespace_matcher = _re.compile(r'\s+')
211  self._long_break_matcher = _re.compile(r'\n\n\n+')
212 

Member Function Documentation

def argparse.HelpFormatter._add_item (   self,
  func,
  args 
)
private

Definition at line 258 of file argparse.py.

Referenced by argparse.HelpFormatter.add_argument(), argparse.HelpFormatter.add_text(), argparse.HelpFormatter.add_usage(), and argparse.HelpFormatter.start_section().

258  def _add_item(self, func, args):
259  self._current_section.items.append((func, args))
260 
def _add_item(self, func, args)
Definition: argparse.py:258
def argparse.HelpFormatter._dedent (   self)
private
def argparse.HelpFormatter._expand_help (   self,
  action 
)
private

Definition at line 610 of file argparse.py.

References argparse.HelpFormatter._get_help_string(), python.rootplot.argparse.HelpFormatter._get_help_string(), python.rootplot.argparse.ArgumentDefaultsHelpFormatter._get_help_string(), argparse.HelpFormatter._prog, python.rootplot.argparse.HelpFormatter._prog, cmsPerfStripChart.dict, join(), list(), and harvestTrackValidationPlots.str.

Referenced by argparse.HelpFormatter._format_action().

610  def _expand_help(self, action):
611  params = dict(vars(action), prog=self._prog)
612  for name in list(params):
613  if params[name] is SUPPRESS:
614  del params[name]
615  if params.get('choices') is not None:
616  choices_str = ', '.join([str(c) for c in params['choices']])
617  params['choices'] = choices_str
618  return self._get_help_string(action) % params
619 
def _expand_help(self, action)
Definition: argparse.py:610
def _get_help_string(self, action)
Definition: argparse.py:640
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def argparse.HelpFormatter._fill_text (   self,
  text,
  width,
  indent 
)
private

Definition at line 635 of file argparse.py.

References digi_MixPreMix_cfi.strip.

Referenced by argparse.HelpFormatter._format_text().

635  def _fill_text(self, text, width, indent):
636  text = self._whitespace_matcher.sub(' ', text).strip()
637  return _textwrap.fill(text, width, initial_indent=indent,
638  subsequent_indent=indent)
639 
def _fill_text(self, text, width, indent)
Definition: argparse.py:635
def argparse.HelpFormatter._format_action (   self,
  action 
)
private

Definition at line 507 of file argparse.py.

References argparse.HelpFormatter._action_max_length, python.rootplot.argparse.HelpFormatter._action_max_length, argparse.HelpFormatter._current_indent, python.rootplot.argparse.HelpFormatter._current_indent, argparse.HelpFormatter._expand_help(), python.rootplot.argparse.HelpFormatter._expand_help(), argparse.HelpFormatter._format_action(), python.rootplot.argparse.HelpFormatter._format_action(), argparse.HelpFormatter._format_action_invocation(), python.rootplot.argparse.HelpFormatter._format_action_invocation(), argparse.HelpFormatter._iter_indented_subactions(), python.rootplot.argparse.HelpFormatter._iter_indented_subactions(), argparse.HelpFormatter._join_parts(), python.rootplot.argparse.HelpFormatter._join_parts(), argparse.HelpFormatter._max_help_position, python.rootplot.argparse.HelpFormatter._max_help_position, extend_argparse.HelpFormatterRespectNewlines._split_lines(), argparse.HelpFormatter._split_lines(), python.rootplot.argparse.HelpFormatter._split_lines(), python.rootplot.argparse.RawTextHelpFormatter._split_lines(), Vispa.Main.RotatingIcon.RotatingIcon._width, Vispa.Gui.VispaWidget.TextField._width, TFitConstraintMGaus._width, argparse.HelpFormatter._width, python.rootplot.argparse.HelpFormatter._width, and min().

Referenced by argparse.HelpFormatter._format_action(), and argparse.HelpFormatter.add_argument().

507  def _format_action(self, action):
508  # determine the required width and the entry label
509  help_position = min(self._action_max_length + 2,
510  self._max_help_position)
511  help_width = self._width - help_position
512  action_width = help_position - self._current_indent - 2
513  action_header = self._format_action_invocation(action)
514 
515  # ho nelp; start on same line and add a final newline
516  if not action.help:
517  tup = self._current_indent, '', action_header
518  action_header = '%*s%s\n' % tup
519 
520  # short action name; start on the same line and pad two spaces
521  elif len(action_header) <= action_width:
522  tup = self._current_indent, '', action_width, action_header
523  action_header = '%*s%-*s ' % tup
524  indent_first = 0
525 
526  # long action name; start on the next line
527  else:
528  tup = self._current_indent, '', action_header
529  action_header = '%*s%s\n' % tup
530  indent_first = help_position
531 
532  # collect the pieces of the action help
533  parts = [action_header]
534 
535  # if there was help for the action, add lines of help text
536  if action.help:
537  help_text = self._expand_help(action)
538  help_lines = self._split_lines(help_text, help_width)
539  parts.append('%*s%s\n' % (indent_first, '', help_lines[0]))
540  for line in help_lines[1:]:
541  parts.append('%*s%s\n' % (help_position, '', line))
542 
543  # or add a newline if the description doesn't end with one
544  elif not action_header.endswith('\n'):
545  parts.append('\n')
546 
547  # if there are any sub-actions, add their help as well
548  for subaction in self._iter_indented_subactions(action):
549  parts.append(self._format_action(subaction))
550 
551  # return a single string
552  return self._join_parts(parts)
553 
def _join_parts(self, part_strings)
Definition: argparse.py:315
def _expand_help(self, action)
Definition: argparse.py:610
def _format_action_invocation(self, action)
Definition: argparse.py:554
def _split_lines(self, text, width)
Definition: argparse.py:631
def _format_action(self, action)
Definition: argparse.py:507
T min(T a, T b)
Definition: MathUtil.h:58
def _iter_indented_subactions(self, action)
Definition: argparse.py:620
def argparse.HelpFormatter._format_action_invocation (   self,
  action 
)
private

Definition at line 554 of file argparse.py.

References argparse.HelpFormatter._format_args(), python.rootplot.argparse.HelpFormatter._format_args(), argparse.HelpFormatter._metavar_formatter(), python.rootplot.argparse.HelpFormatter._metavar_formatter(), and join().

Referenced by argparse.HelpFormatter._format_action(), and argparse.HelpFormatter.add_argument().

554  def _format_action_invocation(self, action):
555  if not action.option_strings:
556  metavar, = self._metavar_formatter(action, action.dest)(1)
557  return metavar
558 
559  else:
560  parts = []
561 
562  # if the Optional doesn't take a value, format is:
563  # -s, --long
564  if action.nargs == 0:
565  parts.extend(action.option_strings)
566 
567  # if the Optional takes a value, format is:
568  # -s ARGS, --long ARGS
569  else:
570  default = action.dest.upper()
571  args_string = self._format_args(action, default)
572  for option_string in action.option_strings:
573  parts.append('%s %s' % (option_string, args_string))
574 
575  return ', '.join(parts)
576 
def _format_args(self, action, default_metavar)
Definition: argparse.py:593
def _metavar_formatter(self, action, default_metavar)
Definition: argparse.py:577
def _format_action_invocation(self, action)
Definition: argparse.py:554
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def argparse.HelpFormatter._format_actions_usage (   self,
  actions,
  groups 
)
private

Definition at line 412 of file argparse.py.

References argparse.HelpFormatter._format_args(), python.rootplot.argparse.HelpFormatter._format_args(), argparse._set, argparse._sorted, and join().

Referenced by argparse.HelpFormatter._format_usage().

412  def _format_actions_usage(self, actions, groups):
413  # find group indices and identify actions in groups
414  group_actions = _set()
415  inserts = {}
416  for group in groups:
417  try:
418  start = actions.index(group._group_actions[0])
419  except ValueError:
420  continue
421  else:
422  end = start + len(group._group_actions)
423  if actions[start:end] == group._group_actions:
424  for action in group._group_actions:
425  group_actions.add(action)
426  if not group.required:
427  inserts[start] = '['
428  inserts[end] = ']'
429  else:
430  inserts[start] = '('
431  inserts[end] = ')'
432  for i in range(start + 1, end):
433  inserts[i] = '|'
434 
435  # collect all actions format strings
436  parts = []
437  for i, action in enumerate(actions):
438 
439  # suppressed arguments are marked with None
440  # remove | separators for suppressed arguments
441  if action.help is SUPPRESS:
442  parts.append(None)
443  if inserts.get(i) == '|':
444  inserts.pop(i)
445  elif inserts.get(i + 1) == '|':
446  inserts.pop(i + 1)
447 
448  # produce all arg strings
449  elif not action.option_strings:
450  part = self._format_args(action, action.dest)
451 
452  # if it's in a group, strip the outer []
453  if action in group_actions:
454  if part[0] == '[' and part[-1] == ']':
455  part = part[1:-1]
456 
457  # add the action string to the list
458  parts.append(part)
459 
460  # produce the first way to invoke the option in brackets
461  else:
462  option_string = action.option_strings[0]
463 
464  # if the Optional doesn't take a value, format is:
465  # -s or --long
466  if action.nargs == 0:
467  part = '%s' % option_string
468 
469  # if the Optional takes a value, format is:
470  # -s ARGS or --long ARGS
471  else:
472  default = action.dest.upper()
473  args_string = self._format_args(action, default)
474  part = '%s %s' % (option_string, args_string)
475 
476  # make it look optional if it's not required or in a group
477  if not action.required and action not in group_actions:
478  part = '[%s]' % part
479 
480  # add the action string to the list
481  parts.append(part)
482 
483  # insert things at the necessary indices
484  for i in _sorted(inserts, reverse=True):
485  parts[i:i] = [inserts[i]]
486 
487  # join all the action items with spaces
488  text = ' '.join([item for item in parts if item is not None])
489 
490  # clean up separators for mutually exclusive groups
491  open = r'[\[(]'
492  close = r'[\])]'
493  text = _re.sub(r'(%s) ' % open, r'\1', text)
494  text = _re.sub(r' (%s)' % close, r'\1', text)
495  text = _re.sub(r'%s *%s' % (open, close), r'', text)
496  text = _re.sub(r'\(([^|]*)\)', r'\1', text)
497  text = text.strip()
498 
499  # return the text
500  return text
501 
def _format_args(self, action, default_metavar)
Definition: argparse.py:593
def _format_actions_usage(self, actions, groups)
Definition: argparse.py:412
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def argparse.HelpFormatter._format_args (   self,
  action,
  default_metavar 
)
private

Definition at line 593 of file argparse.py.

References argparse.HelpFormatter._metavar_formatter(), python.rootplot.argparse.HelpFormatter._metavar_formatter(), and join().

Referenced by argparse.HelpFormatter._format_action_invocation(), and argparse.HelpFormatter._format_actions_usage().

593  def _format_args(self, action, default_metavar):
594  get_metavar = self._metavar_formatter(action, default_metavar)
595  if action.nargs is None:
596  result = '%s' % get_metavar(1)
597  elif action.nargs == OPTIONAL:
598  result = '[%s]' % get_metavar(1)
599  elif action.nargs == ZERO_OR_MORE:
600  result = '[%s [%s ...]]' % get_metavar(2)
601  elif action.nargs == ONE_OR_MORE:
602  result = '%s [%s ...]' % get_metavar(2)
603  elif action.nargs is PARSER:
604  result = '%s ...' % get_metavar(1)
605  else:
606  formats = ['%s' for _ in range(action.nargs)]
607  result = ' '.join(formats) % get_metavar(action.nargs)
608  return result
609 
def _format_args(self, action, default_metavar)
Definition: argparse.py:593
def _metavar_formatter(self, action, default_metavar)
Definition: argparse.py:577
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def argparse.HelpFormatter._format_text (   self,
  text 
)
private
def argparse.HelpFormatter._format_usage (   self,
  usage,
  actions,
  groups,
  prefix 
)
private

Definition at line 320 of file argparse.py.

References crabWrapper._, argparse.HelpFormatter._current_indent, python.rootplot.argparse.HelpFormatter._current_indent, argparse.HelpFormatter._format_actions_usage(), python.rootplot.argparse.HelpFormatter._format_actions_usage(), argparse.HelpFormatter._prog, python.rootplot.argparse.HelpFormatter._prog, Vispa.Main.RotatingIcon.RotatingIcon._width, Vispa.Gui.VispaWidget.TextField._width, TFitConstraintMGaus._width, argparse.HelpFormatter._width, python.rootplot.argparse.HelpFormatter._width, cmsPerfStripChart.dict, and join().

Referenced by argparse.HelpFormatter.add_usage().

320  def _format_usage(self, usage, actions, groups, prefix):
321  if prefix is None:
322  prefix = _('usage: ')
323 
324  # if usage is specified, use that
325  if usage is not None:
326  usage = usage % dict(prog=self._prog)
327 
328  # if no optionals or positionals are available, usage is just prog
329  elif usage is None and not actions:
330  usage = '%(prog)s' % dict(prog=self._prog)
331 
332  # if optionals and positionals are available, calculate usage
333  elif usage is None:
334  prog = '%(prog)s' % dict(prog=self._prog)
335 
336  # split optionals from positionals
337  optionals = []
338  positionals = []
339  for action in actions:
340  if action.option_strings:
341  optionals.append(action)
342  else:
343  positionals.append(action)
344 
345  # build full usage string
346  format = self._format_actions_usage
347  action_usage = format(optionals + positionals, groups)
348  usage = ' '.join([s for s in [prog, action_usage] if s])
349 
350  # wrap the usage parts if it's too long
351  text_width = self._width - self._current_indent
352  if len(prefix) + len(usage) > text_width:
353 
354  # break usage into wrappable parts
355  part_regexp = r'\(.*?\)+|\[.*?\]+|\S+'
356  opt_usage = format(optionals, groups)
357  pos_usage = format(positionals, groups)
358  opt_parts = _re.findall(part_regexp, opt_usage)
359  pos_parts = _re.findall(part_regexp, pos_usage)
360  assert ' '.join(opt_parts) == opt_usage
361  assert ' '.join(pos_parts) == pos_usage
362 
363  # helper for wrapping lines
364  def get_lines(parts, indent, prefix=None):
365  lines = []
366  line = []
367  if prefix is not None:
368  line_len = len(prefix) - 1
369  else:
370  line_len = len(indent) - 1
371  for part in parts:
372  if line_len + 1 + len(part) > text_width:
373  lines.append(indent + ' '.join(line))
374  line = []
375  line_len = len(indent) - 1
376  line.append(part)
377  line_len += len(part) + 1
378  if line:
379  lines.append(indent + ' '.join(line))
380  if prefix is not None:
381  lines[0] = lines[0][len(indent):]
382  return lines
383 
384  # if prog is short, follow it with optionals or positionals
385  if len(prefix) + len(prog) <= 0.75 * text_width:
386  indent = ' ' * (len(prefix) + len(prog) + 1)
387  if opt_parts:
388  lines = get_lines([prog] + opt_parts, indent, prefix)
389  lines.extend(get_lines(pos_parts, indent))
390  elif pos_parts:
391  lines = get_lines([prog] + pos_parts, indent, prefix)
392  else:
393  lines = [prog]
394 
395  # if prog is long, put it on its own line
396  else:
397  indent = ' ' * len(prefix)
398  parts = opt_parts + pos_parts
399  lines = get_lines(parts, indent)
400  if len(lines) > 1:
401  lines = []
402  lines.extend(get_lines(opt_parts, indent))
403  lines.extend(get_lines(pos_parts, indent))
404  lines = [prog] + lines
405 
406  # join lines into usage
407  usage = '\n'.join(lines)
408 
409  # prefix with 'usage:'
410  return '%s%s\n\n' % (prefix, usage)
411 
def _format_usage(self, usage, actions, groups, prefix)
Definition: argparse.py:320
def _format_actions_usage(self, actions, groups)
Definition: argparse.py:412
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def argparse.HelpFormatter._get_help_string (   self,
  action 
)
private

Definition at line 640 of file argparse.py.

Referenced by argparse.HelpFormatter._expand_help().

640  def _get_help_string(self, action):
641  return action.help
642 
643 
def _get_help_string(self, action)
Definition: argparse.py:640
def argparse.HelpFormatter._indent (   self)
private
def argparse.HelpFormatter._iter_indented_subactions (   self,
  action 
)
private

Definition at line 620 of file argparse.py.

References argparse.HelpFormatter._dedent(), python.rootplot.argparse.HelpFormatter._dedent(), argparse.HelpFormatter._indent(), and python.rootplot.argparse.HelpFormatter._indent().

Referenced by argparse.HelpFormatter._format_action(), and argparse.HelpFormatter.add_argument().

620  def _iter_indented_subactions(self, action):
621  try:
622  get_subactions = action._get_subactions
623  except AttributeError:
624  pass
625  else:
626  self._indent()
627  for subaction in get_subactions():
628  yield subaction
629  self._dedent()
630 
def _iter_indented_subactions(self, action)
Definition: argparse.py:620
def argparse.HelpFormatter._join_parts (   self,
  part_strings 
)
private

Definition at line 315 of file argparse.py.

References join().

Referenced by argparse.HelpFormatter._format_action().

315  def _join_parts(self, part_strings):
316  return ''.join([part
317  for part in part_strings
318  if part and part is not SUPPRESS])
319 
def _join_parts(self, part_strings)
Definition: argparse.py:315
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def argparse.HelpFormatter._metavar_formatter (   self,
  action,
  default_metavar 
)
private

Definition at line 577 of file argparse.py.

References cmsPerfStripChart.format, join(), and harvestTrackValidationPlots.str.

Referenced by argparse.HelpFormatter._format_action_invocation(), and argparse.HelpFormatter._format_args().

577  def _metavar_formatter(self, action, default_metavar):
578  if action.metavar is not None:
579  result = action.metavar
580  elif action.choices is not None:
581  choice_strs = [str(choice) for choice in action.choices]
582  result = '{%s}' % ','.join(choice_strs)
583  else:
584  result = default_metavar
585 
586  def format(tuple_size):
587  if isinstance(result, tuple):
588  return result
589  else:
590  return (result, ) * tuple_size
591  return format
592 
def _metavar_formatter(self, action, default_metavar)
Definition: argparse.py:577
format
Some error handling for the usage.
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def argparse.HelpFormatter._split_lines (   self,
  text,
  width 
)
private

Definition at line 631 of file argparse.py.

References digi_MixPreMix_cfi.strip.

Referenced by argparse.HelpFormatter._format_action().

631  def _split_lines(self, text, width):
632  text = self._whitespace_matcher.sub(' ', text).strip()
633  return _textwrap.wrap(text, width)
634 
def _split_lines(self, text, width)
Definition: argparse.py:631
def argparse.HelpFormatter.add_argument (   self,
  action 
)

Definition at line 283 of file argparse.py.

References argparse.HelpFormatter._action_max_length, python.rootplot.argparse.HelpFormatter._action_max_length, argparse.HelpFormatter._add_item(), python.rootplot.argparse.HelpFormatter._add_item(), argparse.HelpFormatter._current_indent, python.rootplot.argparse.HelpFormatter._current_indent, argparse.HelpFormatter._format_action(), python.rootplot.argparse.HelpFormatter._format_action(), argparse.HelpFormatter._format_action_invocation(), python.rootplot.argparse.HelpFormatter._format_action_invocation(), argparse.HelpFormatter._iter_indented_subactions(), python.rootplot.argparse.HelpFormatter._iter_indented_subactions(), and SiStripPI.max.

Referenced by argparse.HelpFormatter.add_arguments().

283  def add_argument(self, action):
284  if action.help is not SUPPRESS:
285 
286  # find all invocations
287  get_invocation = self._format_action_invocation
288  invocations = [get_invocation(action)]
289  for subaction in self._iter_indented_subactions(action):
290  invocations.append(get_invocation(subaction))
291 
292  # update the maximum item length
293  invocation_length = max([len(s) for s in invocations])
294  action_length = invocation_length + self._current_indent
296  action_length)
297 
298  # add the item to the list
299  self._add_item(self._format_action, [action])
300 
def _format_action_invocation(self, action)
Definition: argparse.py:554
def add_argument(self, action)
Definition: argparse.py:283
def _format_action(self, action)
Definition: argparse.py:507
def _iter_indented_subactions(self, action)
Definition: argparse.py:620
def _add_item(self, func, args)
Definition: argparse.py:258
def argparse.HelpFormatter.add_arguments (   self,
  actions 
)

Definition at line 301 of file argparse.py.

References argparse.HelpFormatter.add_argument(), python.rootplot.argparse.HelpFormatter.add_argument(), and python.rootplot.argparse._ActionsContainer.add_argument().

301  def add_arguments(self, actions):
302  for action in actions:
303  self.add_argument(action)
304 
def add_arguments(self, actions)
Definition: argparse.py:301
def add_argument(self, action)
Definition: argparse.py:283
def argparse.HelpFormatter.add_text (   self,
  text 
)

Definition at line 274 of file argparse.py.

References argparse.HelpFormatter._add_item(), python.rootplot.argparse.HelpFormatter._add_item(), argparse.HelpFormatter._format_text(), and python.rootplot.argparse.HelpFormatter._format_text().

274  def add_text(self, text):
275  if text is not SUPPRESS and text is not None:
276  self._add_item(self._format_text, [text])
277 
def _format_text(self, text)
Definition: argparse.py:502
def add_text(self, text)
Definition: argparse.py:274
def _add_item(self, func, args)
Definition: argparse.py:258
def argparse.HelpFormatter.add_usage (   self,
  usage,
  actions,
  groups,
  prefix = None 
)

Definition at line 278 of file argparse.py.

References argparse.HelpFormatter._add_item(), python.rootplot.argparse.HelpFormatter._add_item(), argparse.HelpFormatter._format_usage(), and python.rootplot.argparse.HelpFormatter._format_usage().

278  def add_usage(self, usage, actions, groups, prefix=None):
279  if usage is not SUPPRESS:
280  args = usage, actions, groups, prefix
281  self._add_item(self._format_usage, args)
282 
def _format_usage(self, usage, actions, groups, prefix)
Definition: argparse.py:320
def add_usage(self, usage, actions, groups, prefix=None)
Definition: argparse.py:278
def _add_item(self, func, args)
Definition: argparse.py:258
def argparse.HelpFormatter.end_section (   self)
def argparse.HelpFormatter.format_help (   self)

Definition at line 308 of file argparse.py.

Referenced by argparse.ArgumentParser.print_help().

308  def format_help(self):
309  help = self._root_section.format_help()
310  if help:
311  help = self._long_break_matcher.sub('\n\n', help)
312  help = help.strip('\n') + '\n'
313  return help
314 
def format_help(self)
Definition: argparse.py:308
def argparse.HelpFormatter.start_section (   self,
  heading 
)

Member Data Documentation

argparse.HelpFormatter._action_max_length
private
argparse.HelpFormatter._current_indent
private
argparse.HelpFormatter._current_section
private
argparse.HelpFormatter._indent_increment
private

Definition at line 199 of file argparse.py.

Referenced by argparse.HelpFormatter._dedent(), and argparse.HelpFormatter._indent().

argparse.HelpFormatter._level
private

Definition at line 204 of file argparse.py.

Referenced by argparse.HelpFormatter._dedent(), and argparse.HelpFormatter._indent().

argparse.HelpFormatter._long_break_matcher
private

Definition at line 211 of file argparse.py.

argparse.HelpFormatter._max_help_position
private

Definition at line 200 of file argparse.py.

Referenced by argparse.HelpFormatter._format_action().

argparse.HelpFormatter._prog
private
argparse.HelpFormatter._root_section
private

Definition at line 207 of file argparse.py.

argparse.HelpFormatter._whitespace_matcher
private

Definition at line 210 of file argparse.py.

argparse.HelpFormatter._width
private