|
carputils
Doxygen code documentation for the python framework controlling openCARP
|
Output formatting utilities. More...
Classes | |
| class | Cell |
| class | Summary |
| class | Table |
Functions | |
| def | terminal_width (fallback=70) |
| Get the width of the terminal, in characters. More... | |
| def | hline (char='-', fallback=70) |
| def | header (description, char='-', fallback=70) |
| def | dot_pad (string, length) |
| def | stringtable (strlist, ncolumns=4, padding=3, rowprefix='') |
| def | linewrap (content, length) |
| def | command_line (cmd, optionals=True, cols=None, prefix='') |
| Nicely format a command line for output to terminal. More... | |
Output formatting utilities.
| def carputils.format.command_line | ( | cmd, | |
optionals = True, |
|||
cols = None, |
|||
prefix = '' |
|||
| ) |
Nicely format a command line for output to terminal.
If joining the arguments with single spaces results in a string that will fit on one line, this is returned. Otherwise, a string containing the command line nicely displayed over many lines is returned.
cmd list list of strings representing command line arguments optionals bool, optional If True (default), flags starting with '-' start new lines. If False, all arguments are on new lines. cols int, optional Specify the number of columns to fit inside, default: terminal width prefix str, optional A string to prefix each line of the formatted output
str The formatted command line
| def carputils.format.dot_pad | ( | string, | |
| length | |||
| ) |
| def carputils.format.header | ( | description, | |
char = '-', |
|||
fallback = 70 |
|||
| ) |
| def carputils.format.hline | ( | char = '-', |
|
fallback = 70 |
|||
| ) |
| def carputils.format.linewrap | ( | content, | |
| length | |||
| ) |
| def carputils.format.stringtable | ( | strlist, | |
ncolumns = 4, |
|||
padding = 3, |
|||
rowprefix = '' |
|||
| ) |
| def carputils.format.terminal_width | ( | fallback = 70 | ) |
Get the width of the terminal, in characters.
fallback int The default width to use when the width cannot be determined (default: 100)
int The number of columns in the output
1.8.13