class HelpFormatter:
This class helps with formatting text-based help pages. It's usually just needed for very special internal cases, but it's also exposed so that developers can write their own fancy outputs.
At present, it always writes into memory.
Parameters | |
indent_increment | the additional increment for each level. |
width | the width for the text. This defaults to the terminal width clamped to a maximum of 78. |
Method | __init__ |
Undocumented |
Method | dedent |
Decreases the indentation. |
Method | getvalue |
Returns the buffer contents. |
Method | indent |
Increases the indentation. |
Method | indentation |
A context manager that increases the indentation. |
Method | section |
Helpful context manager that writes a paragraph, a heading, and the indents. |
Method | write |
Writes a unicode string into the internal buffer. |
Method | write_dl |
Writes a definition list into the buffer. This is how options and commands are usually formatted. |
Method | write_heading |
Writes a heading into the buffer. |
Method | write_paragraph |
Writes a paragraph into the buffer. |
Method | write_text |
Writes re-indented text into the buffer. This rewraps and preserves paragraphs. |
Method | write_usage |
Writes a usage line into the buffer. |
Instance Variable | buffer |
Undocumented |
Instance Variable | current_indent |
Undocumented |
Instance Variable | indent_increment |
Undocumented |
Instance Variable | width |
Undocumented |
Undocumented
Parameters | |
indent_increment:int | Undocumented |
width:t.Optional[ | Undocumented |
max_width:t.Optional[ | Undocumented |
Returns | |
t.Iterator[ | Undocumented |
Parameters | |
name:str | the section name that is written as heading. |
Returns | |
t.Iterator[ | Undocumented |
Parameters | |
string:str | Undocumented |
Parameters | |
rows:t.Sequence[ | a list of two item tuples for the terms and values. |
col_max:int | the maximum width of the first column. |
col_spacing:int | the number of spaces between the first and second column. |
Parameters | |
heading:str | Undocumented |
Parameters | |
text:str | Undocumented |