Public Member Functions | |
def | __init__ |
def | __init__ |
def | format_help |
def | format_help |
Public Attributes | |
formatter | |
heading | |
items | |
parent |
Definition at line 194 of file argparse.py.
def argparse::HelpFormatter::_Section::__init__ | ( | self, | |
formatter, | |||
parent, | |||
heading = None |
|||
) |
Definition at line 196 of file argparse.py.
def argparse::HelpFormatter::_Section::__init__ | ( | self, | |
formatter, | |||
parent, | |||
heading = None |
|||
) |
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):
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.