Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Member Functions
argparse.RawDescriptionHelpFormatter Class Reference
Inheritance diagram for argparse.RawDescriptionHelpFormatter:
Inheritance graph
Collaboration diagram for argparse.RawDescriptionHelpFormatter:
Collaboration graph

List of all members.

Public Member Functions

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

Public Attributes

_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Private Member Functions

def _fill_text

Detailed Description

Help message formatter which retains any formatting in descriptions.

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 627 of file

Member Function Documentation

def argparse.RawDescriptionHelpFormatter._fill_text (   self,
) [private]

Reimplemented from argparse.HelpFormatter.

Definition at line 634 of file

00635     def _fill_text(self, text, width, indent):
00636         return ''.join([indent + line for line in text.splitlines(True)])

def argparse.HelpFormatter.add_argument (   self,
) [inherited]

Definition at line 253 of file

00254     def add_argument(self, action):
00255         if is not SUPPRESS:
00257             # find all invocations
00258             get_invocation = self._format_action_invocation
00259             invocations = [get_invocation(action)]
00260             for subaction in self._iter_indented_subactions(action):
00261                 invocations.append(get_invocation(subaction))
00263             # update the maximum item length
00264             invocation_length = max([len(s) for s in invocations])
00265             action_length = invocation_length + self._current_indent
00266             self._action_max_length = max(self._action_max_length,
00267                                           action_length)
00269             # add the item to the list
00270             self._add_item(self._format_action, [action])

Here is the call graph for this function:

Here is the caller graph for this function:

def argparse.HelpFormatter.add_arguments (   self,
) [inherited]

Definition at line 271 of file

00272     def add_arguments(self, actions):
00273         for action in actions:
00274             self.add_argument(action)

Here is the call graph for this function:

def argparse.HelpFormatter.add_text (   self,
) [inherited]

Definition at line 244 of file

00245     def add_text(self, text):
00246         if text is not SUPPRESS and text is not None:
00247             self._add_item(self._format_text, [text])

Here is the call graph for this function:

def argparse.HelpFormatter.add_usage (   self,
  prefix = None 
) [inherited]

Definition at line 248 of file

00249     def add_usage(self, usage, actions, groups, prefix=None):
00250         if usage is not SUPPRESS:
00251             args = usage, actions, groups, prefix
00252             self._add_item(self._format_usage, args)

Here is the call graph for this function:

def argparse.HelpFormatter.end_section (   self) [inherited]

Definition at line 240 of file

00241     def end_section(self):
00242         self._current_section = self._current_section.parent
00243         self._dedent()

Here is the call graph for this function:

def argparse.HelpFormatter.format_help (   self) [inherited]

Definition at line 278 of file

00279     def format_help(self):
00280         help = self._root_section.format_help()
00281         if help:
00282             help = self._long_break_matcher.sub('\n\n', help)
00283             help = help.strip('\n') + '\n'
00284         return help

Here is the caller graph for this function:

def argparse.HelpFormatter.start_section (   self,
) [inherited]

Definition at line 234 of file

00235     def start_section(self, heading):
00236         self._indent()
00237         section = self._Section(self, self._current_section, heading)
00238         self._add_item(section.format_help, [])
00239         self._current_section = section

Here is the call graph for this function:

Member Data Documentation

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

The documentation for this class was generated from the following file: