![]() |
Qucs-S S-parameter Viewer & RF Synthesis Tools
|
Public Member Functions | |
| None | __init__ (self, int indent_increment=2, int|None width=None, int|None max_width=None) |
| None | write (self, str string) |
| None | indent (self) |
| None | dedent (self) |
| None | write_usage (self, str prog, str args="", str|None prefix=None) |
| None | write_heading (self, str heading) |
| None | write_paragraph (self) |
| None | write_text (self, str text) |
| None | write_dl (self, cabc.Sequence[tuple[str, str]] rows, int col_max=30, int col_spacing=2) |
| cabc.Iterator[None] | section (self, str name) |
| cabc.Iterator[None] | indentation (self) |
| str | getvalue (self) |
Public Attributes | |
| indent_increment | |
| width | |
| current_indent | |
| buffer | |
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.
:param indent_increment: the additional increment for each level.
:param width: the width for the text. This defaults to the terminal
width clamped to a maximum of 78.
| None click.formatting.HelpFormatter.dedent | ( | self | ) |
Decreases the indentation.
| str click.formatting.HelpFormatter.getvalue | ( | self | ) |
Returns the buffer contents.
| None click.formatting.HelpFormatter.indent | ( | self | ) |
Increases the indentation.
| cabc.Iterator[None] click.formatting.HelpFormatter.indentation | ( | self | ) |
A context manager that increases the indentation.
| cabc.Iterator[None] click.formatting.HelpFormatter.section | ( | self, | |
| str | name | ||
| ) |
Helpful context manager that writes a paragraph, a heading, and the indents. :param name: the section name that is written as heading.
| None click.formatting.HelpFormatter.write | ( | self, | |
| str | string | ||
| ) |
Writes a unicode string into the internal buffer.
| None click.formatting.HelpFormatter.write_dl | ( | self, | |
| cabc.Sequence[tuple[str, str]] | rows, | ||
| int | col_max = 30, |
||
| int | col_spacing = 2 |
||
| ) |
Writes a definition list into the buffer. This is how options
and commands are usually formatted.
:param rows: a list of two item tuples for the terms and values.
:param col_max: the maximum width of the first column.
:param col_spacing: the number of spaces between the first and
second column.
| None click.formatting.HelpFormatter.write_heading | ( | self, | |
| str | heading | ||
| ) |
Writes a heading into the buffer.
| None click.formatting.HelpFormatter.write_paragraph | ( | self | ) |
Writes a paragraph into the buffer.
| None click.formatting.HelpFormatter.write_text | ( | self, | |
| str | text | ||
| ) |
Writes re-indented text into the buffer. This rewraps and preserves paragraphs.
| None click.formatting.HelpFormatter.write_usage | ( | self, | |
| str | prog, | ||
| str | args = "", |
||
| str | None | prefix = None |
||
| ) |
Writes a usage line into the buffer.
:param prog: the program name.
:param args: whitespace separated list of arguments.
:param prefix: The prefix for the first line. Defaults to
``"Usage: "``.