Functions | |
def | termcolor.canDisplayColor (stream) |
Return True if the stream can display colored text, False otherwise. More... | |
def | termcolor.getControlSequence (color) |
Return the control sequence for the color in parameter, i.e. More... | |
def | termcolor.makeColoredMessage (message, color) |
Return a string that can be used to display the message in parameter with the given color. More... | |
def | termcolor.TEST_termcolor () |
Test function for termcolor module. More... | |
def | KERNEL_PY.kernel.termcolor.canDisplayColor (stream) |
Return True if the stream can display colored text, False otherwise. More... | |
def | KERNEL_PY.kernel.termcolor.getControlSequence (color) |
Return the control sequence for the color in parameter, i.e. More... | |
def | KERNEL_PY.kernel.termcolor.makeColoredMessage (message, color) |
Return a string that can be used to display the message in parameter with the given color. More... | |
def | KERNEL_PY.kernel.termcolor.TEST_termcolor () |
Test function for termcolor module. More... | |
Variables | |
list | termcolor.DEFAULT = ['00'] |
Default color for the terminal. More... | |
list | termcolor.BOLD = ['01'] |
Bold text and brighter colors. More... | |
list | termcolor.UNDERLINED = ['04'] |
Underlined text. More... | |
list | termcolor.BLACK_FG = ['30'] |
Black foreground. More... | |
list | termcolor.RED_FG = ['31'] |
Red foreground. More... | |
list | termcolor.GREEN_FG = ['32'] |
Green foreground. More... | |
list | termcolor.YELLOW_FG = ['33'] |
Yellow foreground. More... | |
list | termcolor.BLUE_FG = ['34'] |
Blue foreground. More... | |
list | termcolor.PURPLE_FG = ['35'] |
Purple foreground. More... | |
list | termcolor.CYAN_FG = ['36'] |
Cyan foreground. More... | |
list | termcolor.WHITE_FG = ['37'] |
White foreground. More... | |
list | termcolor.BLACK_BG = ['40'] |
Black background. More... | |
list | termcolor.RED_BG = ['41'] |
Red background. More... | |
list | termcolor.GREEN_BG = ['42'] |
Green background. More... | |
list | termcolor.YELLOW_BG = ['43'] |
Yellow background. More... | |
list | termcolor.BLUE_BG = ['44'] |
Blue background. More... | |
list | termcolor.PURPLE_BG = ['45'] |
Purple background. More... | |
list | termcolor.CYAN_BG = ['46'] |
Cyan background. More... | |
list | termcolor.WHITE_BG = ['47'] |
White background. More... | |
list | termcolor.BLACK = BLACK_FG |
Black text (equivalent to BLACK_FG) More... | |
list | termcolor.RED = BOLD + RED_FG |
Red text (equivalent to BOLD + RED_FG) More... | |
list | termcolor.GREEN = BOLD + GREEN_FG |
Green text (equivalent to BOLD + GREEN_FG) More... | |
list | termcolor.YELLOW = BOLD + YELLOW_FG |
Yellow text (equivalent to BOLD + YELLOW_FG) More... | |
list | termcolor.BLUE = BOLD + BLUE_FG |
Blue text (equivalent to BOLD + BLUE_FG) More... | |
list | termcolor.PURPLE = BOLD + PURPLE_FG |
Purple text (equivalent to BOLD + PURPLE_FG) More... | |
list | termcolor.CYAN = BOLD + CYAN_FG |
Cyan text (equivalent to BOLD + CYAN_FG) More... | |
list | termcolor.WHITE = WHITE_FG |
White text (equivalent to WHITE_FG) More... | |
list | KERNEL_PY.kernel.termcolor.DEFAULT = ['00'] |
Default color for the terminal. More... | |
list | KERNEL_PY.kernel.termcolor.BOLD = ['01'] |
Bold text and brighter colors. More... | |
list | KERNEL_PY.kernel.termcolor.UNDERLINED = ['04'] |
Underlined text. More... | |
list | KERNEL_PY.kernel.termcolor.BLACK_FG = ['30'] |
Black foreground. More... | |
list | KERNEL_PY.kernel.termcolor.RED_FG = ['31'] |
Red foreground. More... | |
list | KERNEL_PY.kernel.termcolor.GREEN_FG = ['32'] |
Green foreground. More... | |
list | KERNEL_PY.kernel.termcolor.YELLOW_FG = ['33'] |
Yellow foreground. More... | |
list | KERNEL_PY.kernel.termcolor.BLUE_FG = ['34'] |
Blue foreground. More... | |
list | KERNEL_PY.kernel.termcolor.PURPLE_FG = ['35'] |
Purple foreground. More... | |
list | KERNEL_PY.kernel.termcolor.CYAN_FG = ['36'] |
Cyan foreground. More... | |
list | KERNEL_PY.kernel.termcolor.WHITE_FG = ['37'] |
White foreground. More... | |
list | KERNEL_PY.kernel.termcolor.BLACK_BG = ['40'] |
Black background. More... | |
list | KERNEL_PY.kernel.termcolor.RED_BG = ['41'] |
Red background. More... | |
list | KERNEL_PY.kernel.termcolor.GREEN_BG = ['42'] |
Green background. More... | |
list | KERNEL_PY.kernel.termcolor.YELLOW_BG = ['43'] |
Yellow background. More... | |
list | KERNEL_PY.kernel.termcolor.BLUE_BG = ['44'] |
Blue background. More... | |
list | KERNEL_PY.kernel.termcolor.PURPLE_BG = ['45'] |
Purple background. More... | |
list | KERNEL_PY.kernel.termcolor.CYAN_BG = ['46'] |
Cyan background. More... | |
list | KERNEL_PY.kernel.termcolor.WHITE_BG = ['47'] |
White background. More... | |
list | KERNEL_PY.kernel.termcolor.BLACK = BLACK_FG |
Black text (equivalent to BLACK_FG) More... | |
list | KERNEL_PY.kernel.termcolor.RED = BOLD + RED_FG |
Red text (equivalent to BOLD + RED_FG) More... | |
list | KERNEL_PY.kernel.termcolor.GREEN = BOLD + GREEN_FG |
Green text (equivalent to BOLD + GREEN_FG) More... | |
list | KERNEL_PY.kernel.termcolor.YELLOW = BOLD + YELLOW_FG |
Yellow text (equivalent to BOLD + YELLOW_FG) More... | |
list | KERNEL_PY.kernel.termcolor.BLUE = BOLD + BLUE_FG |
Blue text (equivalent to BOLD + BLUE_FG) More... | |
list | KERNEL_PY.kernel.termcolor.PURPLE = BOLD + PURPLE_FG |
Purple text (equivalent to BOLD + PURPLE_FG) More... | |
list | KERNEL_PY.kernel.termcolor.CYAN = BOLD + CYAN_FG |
Cyan text (equivalent to BOLD + CYAN_FG) More... | |
list | KERNEL_PY.kernel.termcolor.WHITE = WHITE_FG |
White text (equivalent to WHITE_FG) More... | |
This module provides utility functions to display colored text in the terminal. It is based on ISO 6429 standard that defines control codes to change characters representation in color-capable ASCII terminals.
In this module, colors are represented as lists of codes, so they can be added to obtain special effects (e.g. RED + GREEN_BG to display red text on green background). Several constants are defined for the most usual codes to facilitate the use of colors, but it is also possible to define colors directly from the corresponding code from ISO 6429 standard. In fact it is even necessary for less usual codes that don't have an associated constant (e.g. PURPLE + ['09'] can be used to display a crossed-out purple text).
def termcolor.canDisplayColor | ( | stream | ) |
Return True if the stream can display colored text, False otherwise.
Referenced by deprecation.__show_colored_warning(), KERNEL_PY.kernel.deprecation.__show_colored_warning(), pyunittester.printfile(), KERNEL_PY.kernel.pyunittester.printfile(), logger.Logger.setColor(), KERNEL_PY.kernel.logger.Logger.setColor(), and TEST_termcolor().
def KERNEL_PY.kernel.termcolor.canDisplayColor | ( | stream | ) |
Return True if the stream can display colored text, False otherwise.
Return True if the stream can display colored text, False otherwise.
Referenced by KERNEL_PY.kernel.termcolor.TEST_termcolor().
def termcolor.getControlSequence | ( | color | ) |
Return the control sequence for the color in parameter, i.e.
the string telling the terminal to display the following text in the given color.
Referenced by makeColoredMessage(), logger.Logger.setColor(), and KERNEL_PY.kernel.logger.Logger.setColor().
def KERNEL_PY.kernel.termcolor.getControlSequence | ( | color | ) |
Return the control sequence for the color in parameter, i.e.
the string telling the terminal to display the following text in the given color.
Return the control sequence for the color in parameter, i.e. the string telling the terminal to display the following text in the given color.
Referenced by KERNEL_PY.kernel.termcolor.makeColoredMessage().
def termcolor.makeColoredMessage | ( | message, | |
color | |||
) |
Return a string that can be used to display the message in parameter with the given color.
References getControlSequence().
Referenced by deprecation.__show_colored_warning(), KERNEL_PY.kernel.deprecation.__show_colored_warning(), pyunittester.printfile(), KERNEL_PY.kernel.pyunittester.printfile(), and TEST_termcolor().
def KERNEL_PY.kernel.termcolor.makeColoredMessage | ( | message, | |
color | |||
) |
Return a string that can be used to display the message in parameter with the given color.
Return a string that can be used to display the message in parameter with the given color.
References KERNEL_PY.kernel.termcolor.getControlSequence().
Referenced by KERNEL_PY.kernel.termcolor.TEST_termcolor().
def termcolor.TEST_termcolor | ( | ) |
Test function for termcolor module.
References canDisplayColor(), and makeColoredMessage().
def KERNEL_PY.kernel.termcolor.TEST_termcolor | ( | ) |
Test function for termcolor module.
Test function for termcolor module.
References KERNEL_PY.kernel.termcolor.canDisplayColor(), and KERNEL_PY.kernel.termcolor.makeColoredMessage().
list termcolor.BLACK = BLACK_FG |
Black text (equivalent to BLACK_FG)
list KERNEL_PY.kernel.termcolor.BLACK = BLACK_FG |
Black text (equivalent to BLACK_FG)
list termcolor.BLACK_BG = ['40'] |
Black background.
list KERNEL_PY.kernel.termcolor.BLACK_BG = ['40'] |
Black background.
list termcolor.BLACK_FG = ['30'] |
Black foreground.
list KERNEL_PY.kernel.termcolor.BLACK_FG = ['30'] |
Black foreground.
list termcolor.BLUE_BG = ['44'] |
Blue background.
list KERNEL_PY.kernel.termcolor.BLUE_BG = ['44'] |
Blue background.
list termcolor.BLUE_FG = ['34'] |
Blue foreground.
list KERNEL_PY.kernel.termcolor.BLUE_FG = ['34'] |
Blue foreground.
list termcolor.BOLD = ['01'] |
Bold text and brighter colors.
list KERNEL_PY.kernel.termcolor.BOLD = ['01'] |
Bold text and brighter colors.
list termcolor.CYAN_BG = ['46'] |
Cyan background.
list KERNEL_PY.kernel.termcolor.CYAN_BG = ['46'] |
Cyan background.
list termcolor.CYAN_FG = ['36'] |
Cyan foreground.
list KERNEL_PY.kernel.termcolor.CYAN_FG = ['36'] |
Cyan foreground.
list termcolor.DEFAULT = ['00'] |
Default color for the terminal.
list KERNEL_PY.kernel.termcolor.DEFAULT = ['00'] |
Default color for the terminal.
list termcolor.GREEN_BG = ['42'] |
Green background.
list KERNEL_PY.kernel.termcolor.GREEN_BG = ['42'] |
Green background.
list termcolor.GREEN_FG = ['32'] |
Green foreground.
list KERNEL_PY.kernel.termcolor.GREEN_FG = ['32'] |
Green foreground.
Purple text (equivalent to BOLD + PURPLE_FG)
list termcolor.PURPLE_BG = ['45'] |
Purple background.
list KERNEL_PY.kernel.termcolor.PURPLE_BG = ['45'] |
Purple background.
list termcolor.PURPLE_FG = ['35'] |
Purple foreground.
list KERNEL_PY.kernel.termcolor.PURPLE_FG = ['35'] |
Purple foreground.
list termcolor.RED_BG = ['41'] |
Red background.
list KERNEL_PY.kernel.termcolor.RED_BG = ['41'] |
Red background.
list termcolor.RED_FG = ['31'] |
Red foreground.
list KERNEL_PY.kernel.termcolor.RED_FG = ['31'] |
Red foreground.
list termcolor.UNDERLINED = ['04'] |
Underlined text.
list KERNEL_PY.kernel.termcolor.UNDERLINED = ['04'] |
Underlined text.
list termcolor.WHITE = WHITE_FG |
White text (equivalent to WHITE_FG)
list KERNEL_PY.kernel.termcolor.WHITE = WHITE_FG |
White text (equivalent to WHITE_FG)
list termcolor.WHITE_BG = ['47'] |
White background.
list KERNEL_PY.kernel.termcolor.WHITE_BG = ['47'] |
White background.
list termcolor.WHITE_FG = ['37'] |
White foreground.
list KERNEL_PY.kernel.termcolor.WHITE_FG = ['37'] |
White foreground.
Yellow text (equivalent to BOLD + YELLOW_FG)
list termcolor.YELLOW_BG = ['43'] |
Yellow background.
list KERNEL_PY.kernel.termcolor.YELLOW_BG = ['43'] |
Yellow background.
list termcolor.YELLOW_FG = ['33'] |
Yellow foreground.
list KERNEL_PY.kernel.termcolor.YELLOW_FG = ['33'] |
Yellow foreground.