CMS 3D CMS Logo

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

Classes

class  _Section
 

Public Member Functions

def __init__
 
def add_argument
 
def add_arguments
 
def add_text
 
def add_usage
 
def end_section
 
def format_help
 
def start_section
 

Private Member Functions

def _add_item
 
def _dedent
 
def _expand_help
 
def _fill_text
 
def _format_action
 
def _format_action_invocation
 
def _format_actions_usage
 
def _format_args
 
def _format_text
 
def _format_usage
 
def _get_help_string
 
def _indent
 
def _iter_indented_subactions
 
def _join_parts
 
def _metavar_formatter
 
def _split_lines
 

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

Constructor & Destructor Documentation

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

Definition at line 193 of file argparse.py.

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

Member Function Documentation

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

Definition at line 263 of file argparse.py.

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

264  def _add_item(self, func, args):
265  self._current_section.items.append((func, args))
def python.rootplot.argparse.HelpFormatter._dedent (   self)
private

Definition at line 225 of file argparse.py.

References argparse.HelpFormatter._current_indent, python.rootplot.argparse.HelpFormatter._current_indent, argparse.HelpFormatter._indent_increment, python.rootplot.argparse.HelpFormatter._indent_increment, PGeometricDet::Item._level, RPCMuonExtraStruct._level, TrackerGeometryCompare._level, MuonGeometryArrange._level, argparse.HelpFormatter._level, and python.rootplot.argparse.HelpFormatter._level.

Referenced by python.rootplot.argparse.HelpFormatter._iter_indented_subactions(), and python.rootplot.argparse.HelpFormatter.end_section().

226  def _dedent(self):
228  assert self._current_indent >= 0, 'Indent decreased below 0.'
229  self._level -= 1
def python.rootplot.argparse.HelpFormatter._expand_help (   self,
  action 
)
private

Definition at line 619 of file argparse.py.

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

Referenced by python.rootplot.argparse.HelpFormatter._format_action().

620  def _expand_help(self, action):
621  params = dict(vars(action), prog=self._prog)
622  for name in list(params):
623  if params[name] is SUPPRESS:
624  del params[name]
625  for name in list(params):
626  if hasattr(params[name], '__name__'):
627  params[name] = params[name].__name__
628  if params.get('choices') is not None:
629  choices_str = ', '.join([str(c) for c in params['choices']])
630  params['choices'] = choices_str
631  return self._get_help_string(action) % params
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 python.rootplot.argparse.HelpFormatter._fill_text (   self,
  text,
  width,
  indent 
)
private

Definition at line 647 of file argparse.py.

References strip().

Referenced by python.rootplot.argparse.HelpFormatter._format_text().

648  def _fill_text(self, text, width, indent):
649  text = self._whitespace_matcher.sub(' ', text).strip()
650  return _textwrap.fill(text, width, initial_indent=indent,
651  subsequent_indent=indent)
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
def python.rootplot.argparse.HelpFormatter._format_action (   self,
  action 
)
private

Definition at line 514 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(), argparse.RawTextHelpFormatter._split_lines(), Vispa.Main.RotatingIcon.RotatingIcon._width, TFitConstraintMGaus._width, Vispa.Gui.VispaWidget.TextField._width, argparse.HelpFormatter._width, python.rootplot.argparse.HelpFormatter._width, and min.

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

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

Definition at line 561 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 python.rootplot.argparse.HelpFormatter._format_action(), and python.rootplot.argparse.HelpFormatter.add_argument().

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

Definition at line 417 of file argparse.py.

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

Referenced by python.rootplot.argparse.HelpFormatter._format_usage().

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

Definition at line 600 of file argparse.py.

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

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

601  def _format_args(self, action, default_metavar):
602  get_metavar = self._metavar_formatter(action, default_metavar)
603  if action.nargs is None:
604  result = '%s' % get_metavar(1)
605  elif action.nargs == OPTIONAL:
606  result = '[%s]' % get_metavar(1)
607  elif action.nargs == ZERO_OR_MORE:
608  result = '[%s [%s ...]]' % get_metavar(2)
609  elif action.nargs == ONE_OR_MORE:
610  result = '%s [%s ...]' % get_metavar(2)
611  elif action.nargs == REMAINDER:
612  result = '...'
613  elif action.nargs == PARSER:
614  result = '%s ...' % get_metavar(1)
615  else:
616  formats = ['%s' for _ in range(action.nargs)]
617  result = ' '.join(formats) % get_metavar(action.nargs)
618  return result
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def python.rootplot.argparse.HelpFormatter._format_text (   self,
  text 
)
private

Definition at line 507 of file argparse.py.

References argparse.HelpFormatter._current_indent, python.rootplot.argparse.HelpFormatter._current_indent, argparse.HelpFormatter._fill_text(), argparse.RawDescriptionHelpFormatter._fill_text(), python.rootplot.argparse.HelpFormatter._fill_text(), argparse.HelpFormatter._prog, python.rootplot.argparse.HelpFormatter._prog, Vispa.Main.RotatingIcon.RotatingIcon._width, TFitConstraintMGaus._width, Vispa.Gui.VispaWidget.TextField._width, argparse.HelpFormatter._width, python.rootplot.argparse.HelpFormatter._width, and python.multivaluedict.dict.

Referenced by python.rootplot.argparse.HelpFormatter.add_text().

508  def _format_text(self, text):
509  if '%(prog)' in text:
510  text = text % dict(prog=self._prog)
511  text_width = self._width - self._current_indent
512  indent = ' ' * self._current_indent
513  return self._fill_text(text, text_width, indent) + '\n\n'
def python.rootplot.argparse.HelpFormatter._format_usage (   self,
  usage,
  actions,
  groups,
  prefix 
)
private

Definition at line 325 of file argparse.py.

References 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, TFitConstraintMGaus._width, Vispa.Gui.VispaWidget.TextField._width, argparse.HelpFormatter._width, python.rootplot.argparse.HelpFormatter._width, python.multivaluedict.dict, and join().

Referenced by python.rootplot.argparse.HelpFormatter.add_usage().

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

Definition at line 652 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter._expand_help().

653  def _get_help_string(self, action):
654  return action.help
655 
def python.rootplot.argparse.HelpFormatter._indent (   self)
private

Definition at line 221 of file argparse.py.

References argparse.HelpFormatter._current_indent, python.rootplot.argparse.HelpFormatter._current_indent, argparse.HelpFormatter._indent_increment, python.rootplot.argparse.HelpFormatter._indent_increment, PGeometricDet::Item._level, RPCMuonExtraStruct._level, TrackerGeometryCompare._level, MuonGeometryArrange._level, argparse.HelpFormatter._level, and python.rootplot.argparse.HelpFormatter._level.

Referenced by python.rootplot.argparse.HelpFormatter._iter_indented_subactions(), and python.rootplot.argparse.HelpFormatter.start_section().

222  def _indent(self):
224  self._level += 1
def python.rootplot.argparse.HelpFormatter._iter_indented_subactions (   self,
  action 
)
private

Definition at line 632 of file argparse.py.

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

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

633  def _iter_indented_subactions(self, action):
634  try:
635  get_subactions = action._get_subactions
636  except AttributeError:
637  pass
638  else:
639  self._indent()
640  for subaction in get_subactions():
641  yield subaction
642  self._dedent()
def python.rootplot.argparse.HelpFormatter._join_parts (   self,
  part_strings 
)
private

Definition at line 320 of file argparse.py.

References join().

Referenced by python.rootplot.argparse.HelpFormatter._format_action().

321  def _join_parts(self, part_strings):
322  return ''.join([part
323  for part in part_strings
324  if part and part is not SUPPRESS])
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def python.rootplot.argparse.HelpFormatter._metavar_formatter (   self,
  action,
  default_metavar 
)
private

Definition at line 584 of file argparse.py.

References cmsPerfStripChart.format, and join().

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

585  def _metavar_formatter(self, action, default_metavar):
586  if action.metavar is not None:
587  result = action.metavar
588  elif action.choices is not None:
589  choice_strs = [str(choice) for choice in action.choices]
590  result = '{%s}' % ','.join(choice_strs)
591  else:
592  result = default_metavar
593 
594  def format(tuple_size):
595  if isinstance(result, tuple):
596  return result
597  else:
598  return (result, ) * tuple_size
599  return format
string format
Some error handling for the usage.
static std::string join(char **cmd)
Definition: RemoteFile.cc:18
def python.rootplot.argparse.HelpFormatter._split_lines (   self,
  text,
  width 
)
private

Definition at line 643 of file argparse.py.

References strip().

Referenced by python.rootplot.argparse.HelpFormatter._format_action().

644  def _split_lines(self, text, width):
645  text = self._whitespace_matcher.sub(' ', text).strip()
646  return _textwrap.wrap(text, width)
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
def python.rootplot.argparse.HelpFormatter.add_argument (   self,
  action 
)

Definition at line 288 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 max().

Referenced by python.rootplot.argparse.HelpFormatter.add_arguments().

289  def add_argument(self, action):
290  if action.help is not SUPPRESS:
291 
292  # find all invocations
293  get_invocation = self._format_action_invocation
294  invocations = [get_invocation(action)]
295  for subaction in self._iter_indented_subactions(action):
296  invocations.append(get_invocation(subaction))
297 
298  # update the maximum item length
299  invocation_length = max([len(s) for s in invocations])
300  action_length = invocation_length + self._current_indent
302  action_length)
303 
304  # add the item to the list
305  self._add_item(self._format_action, [action])
const T & max(const T &a, const T &b)
def python.rootplot.argparse.HelpFormatter.add_arguments (   self,
  actions 
)

Definition at line 306 of file argparse.py.

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

307  def add_arguments(self, actions):
308  for action in actions:
309  self.add_argument(action)
def python.rootplot.argparse.HelpFormatter.add_text (   self,
  text 
)

Definition at line 279 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().

280  def add_text(self, text):
281  if text is not SUPPRESS and text is not None:
282  self._add_item(self._format_text, [text])
def python.rootplot.argparse.HelpFormatter.add_usage (   self,
  usage,
  actions,
  groups,
  prefix = None 
)

Definition at line 283 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().

284  def add_usage(self, usage, actions, groups, prefix=None):
285  if usage is not SUPPRESS:
286  args = usage, actions, groups, prefix
287  self._add_item(self._format_usage, args)
def python.rootplot.argparse.HelpFormatter.end_section (   self)

Definition at line 275 of file argparse.py.

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

276  def end_section(self):
277  self._current_section = self._current_section.parent
278  self._dedent()
def python.rootplot.argparse.HelpFormatter.format_help (   self)

Definition at line 313 of file argparse.py.

Referenced by python.rootplot.argparse.ArgumentParser.print_help().

314  def format_help(self):
315  help = self._root_section.format_help()
316  if help:
317  help = self._long_break_matcher.sub('\n\n', help)
318  help = help.strip('\n') + '\n'
319  return help
def python.rootplot.argparse.HelpFormatter.start_section (   self,
  heading 
)

Definition at line 269 of file argparse.py.

References argparse.HelpFormatter._add_item(), python.rootplot.argparse.HelpFormatter._add_item(), argparse.HelpFormatter._current_section, python.rootplot.argparse.HelpFormatter._current_section, argparse.HelpFormatter._indent(), and python.rootplot.argparse.HelpFormatter._indent().

270  def start_section(self, heading):
271  self._indent()
272  section = self._Section(self, self._current_section, heading)
273  self._add_item(section.format_help, [])
274  self._current_section = section

Member Data Documentation

python.rootplot.argparse.HelpFormatter._action_max_length
private

Definition at line 210 of file argparse.py.

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

python.rootplot.argparse.HelpFormatter._current_indent
private

Definition at line 208 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter._dedent(), python.rootplot.argparse.HelpFormatter._format_action(), python.rootplot.argparse.HelpFormatter._format_text(), python.rootplot.argparse.HelpFormatter._format_usage(), python.rootplot.argparse.HelpFormatter._indent(), and python.rootplot.argparse.HelpFormatter.add_argument().

python.rootplot.argparse.HelpFormatter._current_section
private

Definition at line 213 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter.end_section(), and python.rootplot.argparse.HelpFormatter.start_section().

python.rootplot.argparse.HelpFormatter._indent_increment
private

Definition at line 204 of file argparse.py.

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

python.rootplot.argparse.HelpFormatter._level
private

Definition at line 209 of file argparse.py.

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

python.rootplot.argparse.HelpFormatter._long_break_matcher
private

Definition at line 216 of file argparse.py.

python.rootplot.argparse.HelpFormatter._max_help_position
private

Definition at line 205 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter._format_action().

python.rootplot.argparse.HelpFormatter._prog
private

Definition at line 203 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter._expand_help(), python.rootplot.argparse.HelpFormatter._format_text(), and python.rootplot.argparse.HelpFormatter._format_usage().

python.rootplot.argparse.HelpFormatter._root_section
private

Definition at line 212 of file argparse.py.

python.rootplot.argparse.HelpFormatter._whitespace_matcher
private

Definition at line 215 of file argparse.py.

python.rootplot.argparse.HelpFormatter._width
private

Definition at line 206 of file argparse.py.

Referenced by python.rootplot.argparse.HelpFormatter._format_action(), python.rootplot.argparse.HelpFormatter._format_text(), and python.rootplot.argparse.HelpFormatter._format_usage().