CMS 3D CMS Logo

Public Member Functions | Public Attributes

argparse::HelpFormatter::_Section Class Reference

List of all members.

Public Member Functions

def __init__
def __init__
def format_help
def format_help

Public Attributes

 formatter
 heading
 items
 parent

Detailed Description

Definition at line 194 of file argparse.py.


Constructor & Destructor Documentation

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

Definition at line 196 of file argparse.py.

00197                                                            :
00198             self.formatter = formatter
00199             self.parent = parent
00200             self.heading = heading
00201             self.items = []

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

Definition at line 227 of file argparse.py.

00227                                                            :
00228             self.formatter = formatter
00229             self.parent = parent
00230             self.heading = heading
00231             self.items = []
00232 

Member Function Documentation

def argparse::HelpFormatter::_Section::format_help (   self)

Definition at line 202 of file argparse.py.

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

Definition at line 233 of file argparse.py.

00233                              :
00234             # format the indented section
00235             if self.parent is not None:
00236                 self.formatter._indent()
00237             join = self.formatter._join_parts
00238             for func, args in self.items:
00239                 func(*args)
00240             item_help = join([func(*args) for func, args in self.items])
00241             if self.parent is not None:
00242                 self.formatter._dedent()
00243 
00244             # return nothing if the section was empty
00245             if not item_help:
00246                 return ''
00247 
00248             # add the heading if the section was non-empty
00249             if self.heading is not SUPPRESS and self.heading is not None:
00250                 current_indent = self.formatter._current_indent
00251                 heading = '%*s%s:\n' % (current_indent, '', self.heading)
00252             else:
00253                 heading = ''
00254 
00255             # join the section-initial newline, the heading and the help
00256             return join(['\n', heading, item_help, '\n'])
00257 
00258     def _add_item(self, func, args):

Member Data Documentation

Definition at line 196 of file argparse.py.

Definition at line 196 of file argparse.py.

Definition at line 196 of file argparse.py.

Definition at line 196 of file argparse.py.