##// END OF EJS Templates
Reify colors from debugger. (#14387)...
M Bussonnier -
r28718:38aa68c3 merge
parent child Browse files
Show More
@@ -253,21 +253,6 b' class Pdb(OldPdb):'
253 C = coloransi.TermColors
253 C = coloransi.TermColors
254 cst = self.color_scheme_table
254 cst = self.color_scheme_table
255
255
256 cst['NoColor'].colors.prompt = C.NoColor
257 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
258 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
259
260 cst['Linux'].colors.prompt = C.Green
261 cst['Linux'].colors.breakpoint_enabled = C.LightRed
262 cst['Linux'].colors.breakpoint_disabled = C.Red
263
264 cst['LightBG'].colors.prompt = C.Blue
265 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
266 cst['LightBG'].colors.breakpoint_disabled = C.Red
267
268 cst['Neutral'].colors.prompt = C.Blue
269 cst['Neutral'].colors.breakpoint_enabled = C.LightRed
270 cst['Neutral'].colors.breakpoint_disabled = C.Red
271
256
272 # Add a python parser so we can syntax highlight source while
257 # Add a python parser so we can syntax highlight source while
273 # debugging.
258 # debugging.
@@ -34,9 +34,10 b' def exception_colors():'
34 >>> ec.active_scheme_name
34 >>> ec.active_scheme_name
35 'NoColor'
35 'NoColor'
36 >>> sorted(ec.active_colors.keys())
36 >>> sorted(ec.active_colors.keys())
37 ['Normal', 'caret', 'em', 'excName', 'filename', 'filenameEm', 'line',
37 ['Normal', 'breakpoint_disabled', 'breakpoint_enabled', 'caret', 'em',
38 'lineno', 'linenoEm', 'name', 'nameEm', 'normalEm', 'topline', 'vName',
38 'excName', 'filename', 'filenameEm', 'line', 'lineno', 'linenoEm', 'name',
39 'val', 'valEm']
39 'nameEm', 'normalEm', 'prompt', 'topline', 'vName', 'val', 'valEm']
40
40 """
41 """
41
42
42 ex_colors = ColorSchemeTable()
43 ex_colors = ColorSchemeTable()
@@ -70,6 +71,10 b' def exception_colors():'
70 "line": C.NoColor,
71 "line": C.NoColor,
71 "caret": C.NoColor,
72 "caret": C.NoColor,
72 "Normal": C.NoColor,
73 "Normal": C.NoColor,
74 # debugger
75 "prompt": C.NoColor,
76 "breakpoint_enabled": C.NoColor,
77 "breakpoint_disabled": C.NoColor,
73 },
78 },
74 )
79 )
75 )
80 )
@@ -99,6 +104,10 b' def exception_colors():'
99 "line": C.Yellow,
104 "line": C.Yellow,
100 "caret": C.White,
105 "caret": C.White,
101 "Normal": C.Normal,
106 "Normal": C.Normal,
107 # debugger
108 "prompt": C.Green,
109 "breakpoint_enabled": C.LightRed,
110 "breakpoint_disabled": C.Red,
102 },
111 },
103 )
112 )
104 )
113 )
@@ -132,6 +141,10 b' def exception_colors():'
132 "line": C.Red,
141 "line": C.Red,
133 "caret": C.Normal,
142 "caret": C.Normal,
134 "Normal": C.Normal,
143 "Normal": C.Normal,
144 # debugger
145 "prompt": C.Blue,
146 "breakpoint_enabled": C.LightRed,
147 "breakpoint_disabled": C.Red,
135 },
148 },
136 )
149 )
137 )
150 )
@@ -161,6 +174,10 b' def exception_colors():'
161 "line": C.Red,
174 "line": C.Red,
162 "caret": C.Normal,
175 "caret": C.Normal,
163 "Normal": C.Normal,
176 "Normal": C.Normal,
177 # debugger
178 "prompt": C.Blue,
179 "breakpoint_enabled": C.LightRed,
180 "breakpoint_disabled": C.Red,
164 },
181 },
165 )
182 )
166 )
183 )
@@ -71,8 +71,34 b' class TermColors:'
71 Normal = '\033[0m' # Reset normal coloring
71 Normal = '\033[0m' # Reset normal coloring
72 _base = '\033[%sm' # Template for all other colors
72 _base = '\033[%sm' # Template for all other colors
73
73
74 # Build the actual color table as a set of class attributes:
74 Black = "0;30"
75 make_color_table(TermColors)
75 Red = "0;31"
76 Green = "0;32"
77 Brown = "0;33"
78 Blue = "0;34"
79 Purple = "0;35"
80 Cyan = "0;36"
81 LightGray = "0;37"
82 # Light colors
83 DarkGray = "1;31"
84 LightRed = "1;32"
85 LightGreen = "1;33"
86 Yellow = "1;34"
87 LightBlue = "1;35"
88 LightPurple = "1;36"
89 LightCyan = "1;37"
90 White = "1;38"
91 # Blinking colors. Probably should not be used in anything serious.
92 BlinkBlack = "5;30"
93 BlinkRed = "5;31"
94 BlinkGreen = "5;32"
95 BlinkYellow = "5;33"
96 BlinkBlue = "5;34"
97 BlinkPurple = "5;35"
98 BlinkCyan = "5;36"
99 BlinkLightGray = "5;37"
100
101
76
102
77 class InputTermColors:
103 class InputTermColors:
78 """Color escape sequences for input prompts.
104 """Color escape sequences for input prompts.
General Comments 0
You need to be logged in to leave comments. Login now