class documentation

class ColorizedTextReporter(TextReporter): (source)

View In Hierarchy

Simple TextReporter that colorizes text output.

Method __init__ Undocumented
Method handle_message Manage message of different types, and colorize output using ANSI escape codes.
Constant COLOR_MAPPING Undocumented
Class Variable name Name of the reporter.
Instance Variable color_mapping Undocumented
Instance Variable out Undocumented
Method _get_decoration Returns the message style as defined in self.color_mapping.

Inherited from TextReporter:

Method on_set_current_module Set the format template to be used and check for unrecognized arguments.
Method write_message Convenience method to write a formatted message with class default template.
Class Variable extension Undocumented
Class Variable line_format Undocumented
Method _display Launch layouts display.
Instance Variable _fixed_template The output format template with any unrecognized arguments removed.
Instance Variable _modules Undocumented
Instance Variable _template Undocumented

Inherited from BaseReporter (via TextReporter):

Method display_messages Hook for displaying the messages of the reporter.
Method display_reports Display results encapsulated in the layout tree.
Method on_close Hook called when a module finished analyzing.
Method set_output Set output stream.
Method writeln Write a line in the output buffer.
Instance Variable linter Undocumented
Instance Variable messages Undocumented
Instance Variable path_strip_prefix Undocumented
Instance Variable section Undocumented
def __init__(self, output: TextIO|None = None, color_mapping: (ColorMappingDict|dict[str, tuple[str|None, str]])|None = None): (source)
def handle_message(self, msg: Message): (source)

Manage message of different types, and colorize output using ANSI escape codes.

Undocumented

Value
{'I': MessageStyle('green'),
 'C': MessageStyle(None, ('bold')),
 'R': MessageStyle('magenta', ('bold', 'italic')),
 'W': MessageStyle('magenta'),
 'E': MessageStyle('red', ('bold')),
 'F': MessageStyle('red', ('bold', 'underline')),
 'S': MessageStyle('yellow', ('inverse'))}

Name of the reporter.

color_mapping = (source)

Undocumented

def _get_decoration(self, msg_id: str) -> MessageStyle: (source)

Returns the message style as defined in self.color_mapping.