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.
D.clear() -> None. Remove all items from D.
Return full copy of object
v defaults to None.
D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
D.has_key(k) -> True if D has a key k, else False
D.items() -> list of D’s (key, value) pairs, as 2-tuples
D.iteritems() -> an iterator over the (key, value) items of D
D.iterkeys() -> an iterator over the keys of D
D.itervalues() -> an iterator over the values of D
D.keys() -> list of D’s keys
D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised
D.popitem() -> (k, v), remove and return some (key, value) pair as a 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.
D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
D.update(E, **F) -> None. Update D from dict/iterable E and F. If E has a .keys() method, does: for k in E: D[k] = E[k] If E 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]
D.values() -> list of D’s values
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.
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.