##// END OF EJS Templates
Deduplicate code
Matthias Bussonnier -
Show More
@@ -58,28 +58,7 b' _builtin_meth_type = type(str.upper) # Bound methods have the same type as buil'
58 58
59 59 Colors = TermColors # just a shorthand
60 60
61 # Build a few color schemes
62 NoColor = ColorScheme(
63 'NoColor',{
64 'header' : Colors.NoColor,
65 'normal' : Colors.NoColor # color off (usu. Colors.Normal)
66 } )
67
68 LinuxColors = ColorScheme(
69 'Linux',{
70 'header' : Colors.LightRed,
71 'normal' : Colors.Normal # color off (usu. Colors.Normal)
72 } )
73
74 LightBGColors = ColorScheme(
75 'LightBG',{
76 'header' : Colors.Red,
77 'normal' : Colors.Normal # color off (usu. Colors.Normal)
78 } )
79
80 # Build table of color schemes (needed by the parser)
81 InspectColors = ColorSchemeTable([NoColor,LinuxColors,LightBGColors],
82 'Linux')
61 InspectColors = PyColorize.ANSICodeColors
83 62
84 63 #****************************************************************************
85 64 # Auxiliary functions and objects
@@ -51,7 +51,7 b' except AttributeError:'
51 51 # strings, not bytes. See also Python issue #9969.
52 52 generate_tokens = tokenize._tokenize
53 53
54 from IPython.utils.coloransi import *
54 from IPython.utils.coloransi import TermColors, InputTermColors ,ColorScheme, ColorSchemeTable
55 55 from IPython.utils.py3compat import PY3
56 56
57 57 if PY3:
@@ -74,6 +74,7 b' Colors = TermColors # just a shorthand'
74 74 # Build a few color schemes
75 75 NoColor = ColorScheme(
76 76 'NoColor',{
77 'header' : Colors.NoColor,
77 78 token.NUMBER : Colors.NoColor,
78 79 token.OP : Colors.NoColor,
79 80 token.STRING : Colors.NoColor,
@@ -89,6 +90,7 b' NoColor = ColorScheme('
89 90
90 91 LinuxColors = ColorScheme(
91 92 'Linux',{
93 'header' : Colors.LightRed,
92 94 token.NUMBER : Colors.LightCyan,
93 95 token.OP : Colors.Yellow,
94 96 token.STRING : Colors.LightBlue,
@@ -104,6 +106,7 b' LinuxColors = ColorScheme('
104 106
105 107 LightBGColors = ColorScheme(
106 108 'LightBG',{
109 'header' : Colors.Red,
107 110 token.NUMBER : Colors.Cyan,
108 111 token.OP : Colors.Blue,
109 112 token.STRING : Colors.Blue,
General Comments 0
You need to be logged in to leave comments. Login now