class documentation
class FancyFormatter: (source)
Apply color and bold font to terminal output. This currently only works on Linux and Mac.
Method | __init__ |
Undocumented |
Method | colorize |
Colorize an output line by highlighting the status and error code. |
Method | fit |
Improve readability by wrapping error messages and trimming source code. |
Method | format |
Format a short summary in case of errors. |
Method | format |
Format short summary in case of success. |
Method | highlight |
Make groups quoted with double quotes bold (including quotes). |
Method | initialize |
Return True if initialization was successful and we can use colors, False otherwise |
Method | initialize |
Return True if initialization was successful and we can use colors, False otherwise |
Method | initialize |
Return True if initialization was successful and we can use colors, False otherwise |
Method | style |
Apply simple color and style (underlined or bold). |
Method | underline |
Underline a link in a note message (if any). |
Instance Variable | BLUE |
Undocumented |
Instance Variable | BOLD |
Undocumented |
Instance Variable | colors |
Undocumented |
Instance Variable | DIM |
Undocumented |
Instance Variable | dummy |
Undocumented |
Instance Variable | GREEN |
Undocumented |
Instance Variable | hide |
Undocumented |
Instance Variable | NORMAL |
Undocumented |
Instance Variable | RED |
Undocumented |
Instance Variable | UNDER |
Undocumented |
Instance Variable | YELLOW |
Undocumented |
def fit_in_terminal(self, messages:
list[ str]
, fixed_terminal_width: int|None
= None) -> list[ str]
:
(source)
¶
Improve readability by wrapping error messages and trimming source code.
def format_error(self, n_errors:
int
, n_files: int
, n_sources: int
, *, blockers: bool
= False, use_color: bool
= True) -> str
:
(source)
¶
Format a short summary in case of errors.
Format short summary in case of success. n_sources is total number of files passed directly on command line, i.e. excluding stubs and followed imports.
Make groups quoted with double quotes bold (including quotes). This is used to highlight types, attribute names etc.
def style(self, text:
str
, color: Literal[ 'red', 'green', 'blue', 'yellow', 'none']
, bold: bool
= False, underline: bool
= False, dim: bool
= False) -> str
:
(source)
¶
Apply simple color and style (underlined or bold).