Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes
argparse.HelpFormatter._Section Class Reference
Inheritance diagram for argparse.HelpFormatter._Section:
Inheritance graph
[legend]
Collaboration diagram for argparse.HelpFormatter._Section:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def format_help

Public Attributes

 formatter
 parent
 heading
 items
_PyObject_HEAD_EXTRA Py_ssize_t ob_refcnt
struct _typeobjectob_type

Detailed Description

Definition at line 195 of file argparse.py.


Constructor & Destructor Documentation

def argparse.HelpFormatter._Section.__init__ (   self,
  formatter,
  parent,
  heading = None 
)

Definition at line 197 of file argparse.py.

00197 
00198         def __init__(self, formatter, parent, heading=None):
00199             self.formatter = formatter
00200             self.parent = parent
00201             self.heading = heading
00202             self.items = []

Here is the caller graph for this function:


Member Function Documentation

Definition at line 203 of file argparse.py.

00203 
00204         def format_help(self):
00205             # format the indented section
00206             if self.parent is not None:
00207                 self.formatter._indent()
00208             join = self.formatter._join_parts
00209             for func, args in self.items:
00210                 func(*args)
00211             item_help = join([func(*args) for func, args in self.items])
00212             if self.parent is not None:
00213                 self.formatter._dedent()
00214 
00215             # return nothing if the section was empty
00216             if not item_help:
00217                 return ''
00218 
00219             # add the heading if the section was non-empty
00220             if self.heading is not SUPPRESS and self.heading is not None:
00221                 current_indent = self.formatter._current_indent
00222                 heading = '%*s%s:\n' % (current_indent, '', self.heading)
00223             else:
00224                 heading = ''
00225 
00226             # join the section-initial newline, the heading and the help
00227             return join(['\n', heading, item_help, '\n'])
00228 
    def _add_item(self, func, args):

Here is the caller graph for this function:


Member Data Documentation

Definition at line 198 of file argparse.py.

Definition at line 200 of file argparse.py.

Definition at line 201 of file argparse.py.

Definition at line 107 of file object.h.

struct _typeobject* _object::ob_type [inherited]

Definition at line 108 of file object.h.

Definition at line 199 of file argparse.py.


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