argread.clitext
: Process help messages for console output
This module provides the function compile_rst()
to turn a
docstring or other Python string into a format that is appropriate to
print to STDOUT. It uses ANSI escape characters to produce bold text if
available.
-
lfc._vendor.argread.clitext.bold(txt: str) → str
Produce bold text string for console
- Call:
-
- Inputs:
- txt:
str
Text to mark as bold
- Outputs:
- out:
str
Compiled text
-
lfc._vendor.argread.clitext.bolditalic(txt: str) → str
Produce bold-italic text string for console
- Call:
-
- Inputs:
- txt:
str
Text to mark as bold
- Outputs:
- out:
str
Compiled text
-
lfc._vendor.argread.clitext.compile_rst(doc: str) → str
Remove some extraneous markup for command-line help messages
- Call:
>>> txt = _compile_rst(doc)
- Inputs:
- doc:
str
A multiline string in Sphinx reST syntax
- Outputs:
- txt:
str
A string formatted for command-line output
-
lfc._vendor.argread.clitext.get_nstart(line: str, c: str) → int
Count number of instances of character c at start of a line
- Call:
>>> nc = get_nstart(line, c)
- Inputs:
- line:
str
| unicode
String
- c:
str
Character
- Outputs:
- nc:
int
>= 0 Number of times c occurs at beginning of string (can be 0)
-
lfc._vendor.argread.clitext.italic(txt: str) → str
Produce italic text string for console
- Call:
-
- Inputs:
- txt:
str
Text to mark as bold
- Outputs:
- out:
str
Compiled text