TerminalPrinter#
- class montreal_forced_aligner.helper.TerminalPrinter(print_function=None)[source]#
Bases:
objectHelper class to output colorized text
- Parameters:
print_function (Callable, optional) – Function to print information, defaults to
print- Variables:
colors (dict[str, str]) – Mapping of color names to terminal codes in colorama (or empty strings if the global terminal_colors flag is set to False)
- emphasized_text(text)[source]#
Highlight text as emphasis
- Parameters:
text (Any) – Text to highlight
- Returns:
Highlighted text
- Return type:
- error_text(text)[source]#
Highlight text as an error
- Parameters:
text (Any) – Text to highlight
- Returns:
Highlighted text
- Return type:
- property indent_string#
Indent string to use in formatting the output messages
- pass_text(text)[source]#
Highlight text as good
- Parameters:
text (Any) – Text to highlight
- Returns:
Highlighted text
- Return type:
- print_green_stat(stat, text)[source]#
Print a statistic in green
- Parameters:
stat (Any) – Statistic to print
text (str) – Other text to follow statistic
- print_header(header)[source]#
Print a section header
- Parameters:
header (str) – Section header string
- print_information_line(key, value, key_color=None, value_color=None, level=1)[source]#
Pretty print a given configuration line
- print_red_stat(stat, text)[source]#
Print a statistic in red
- Parameters:
stat (Any) – Statistic to print
text (str) – Other text to follow statistic
- print_sub_header(header)[source]#
Print a subsection header
- Parameters:
header (str) – Subsection header string