module documentation

Undocumented

Class ​Help​Formatter 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.
Constant FORCED​_WIDTH Undocumented
Function iter​_rows Undocumented
Function join​_options No summary
Function measure​_table Undocumented
Function wrap​_text No summary
FORCED_WIDTH: t.Optional[int] =

Undocumented

Value
None
def iter_rows(rows, col_count):

Undocumented

Parameters
rows:t.Iterable[t.Tuple[str, str]]Undocumented
col​_count:intUndocumented
Returns
t.Iterator[t.Tuple[str, ...]]Undocumented
def join_options(options):
Given a list of option strings this joins them in the most appropriate way and returns them in the form (formatted_string, any_prefix_is_slash) where the second item in the tuple is a flag that indicates if any of the option prefixes was a slash.
Parameters
options:t.Sequence[str]Undocumented
Returns
t.Tuple[str, bool]Undocumented
def measure_table(rows):

Undocumented

Parameters
rows:t.Iterable[t.Tuple[str, str]]Undocumented
Returns
t.Tuple[int, ...]Undocumented
def wrap_text(text, width=78, initial_indent='', subsequent_indent='', preserve_paragraphs=False):

A helper function that intelligently wraps text. By default, it assumes that it operates on a single paragraph of text but if the preserve_paragraphs parameter is provided it will intelligently handle paragraphs (defined by two empty lines).

If paragraphs are handled, a paragraph can be prefixed with an empty line containing the \b character (\x08) to indicate that no rewrapping should happen in that block.

Parameters
text:strthe text that should be rewrapped.
width:intthe maximum width for the text.
initial​_indent:strthe initial indent that should be placed on the first line as a string.
subsequent​_indent:strthe indent string that should be placed on each consecutive line.
preserve​_paragraphs:boolif this flag is set then the wrapping will intelligently handle paragraphs.
Returns
strUndocumented