Inheritance diagram for IPython.utils.coloransi:
Tools for coloring text in ANSI terminals.
Bases: dict
General class to handle tables of color schemes.
It’s basically a dict of color schemes with a couple of shorthand attributes and some convenient methods.
active_scheme_name -> obvious active_colors -> actual color table of the active scheme
Create a table of color schemes.
The table can be created empty and manually filled or it can be created with a list of valid color schemes AND the specification for the default active scheme.
Add a new color scheme to the table.
Return full copy of object
v defaults to None.
If key is not found, d is returned if given, otherwise KeyError is raised
2-tuple; but raise KeyError if D is empty.
Set the currently active scheme.
Names are by default compared in a case-insensitive way, but this can be changed by setting the parameter case_sensitive to true.
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
Color escape sequences for input prompts.
This class is similar to TermColors, but the escapes are wrapped in and so that readline can properly know the length of each line and can wrap lines accordingly. Use this class for any colored text which needs to be used in input prompts, such as in calls to raw_input().
This class defines the escape sequences for all the standard (ANSI?) colors in terminals. Also defines a NoColor escape which is just the null string, suitable for defining ‘dummy’ color schemes in terminals which get confused by color escapes.
This class should be used as a mixin for building color schemes.
This defines all the same names as the colour classes, but maps them to empty strings, so it can easily be substituted to turn off colours.
Color escape sequences.
This class defines the escape sequences for all the standard (ANSI?) colors in terminals. Also defines a NoColor escape which is just the null string, suitable for defining ‘dummy’ color schemes in terminals which get confused by color escapes.
This class should be used as a mixin for building color schemes.