##// END OF EJS Templates
Reify colors from debugger.
Matthias Bussonnier -
Show More
@@ -159,13 +159,6 b' def BdbQuit_excepthook(et, ev, tb, excepthook=None):'
159 159 "`BdbQuit_excepthook` is deprecated since version 5.1",
160 160 )
161 161
162
163 def BdbQuit_IPython_excepthook(self, et, ev, tb, tb_offset=None):
164 raise ValueError(
165 "`BdbQuit_IPython_excepthook` is deprecated since version 5.1",
166 DeprecationWarning, stacklevel=2)
167
168
169 162 RGX_EXTRA_INDENT = re.compile(r'(?<=\n)\s+')
170 163
171 164
@@ -270,21 +263,6 b' class Pdb(OldPdb):'
270 263 C = coloransi.TermColors
271 264 cst = self.color_scheme_table
272 265
273 cst['NoColor'].colors.prompt = C.NoColor
274 cst['NoColor'].colors.breakpoint_enabled = C.NoColor
275 cst['NoColor'].colors.breakpoint_disabled = C.NoColor
276
277 cst['Linux'].colors.prompt = C.Green
278 cst['Linux'].colors.breakpoint_enabled = C.LightRed
279 cst['Linux'].colors.breakpoint_disabled = C.Red
280
281 cst['LightBG'].colors.prompt = C.Blue
282 cst['LightBG'].colors.breakpoint_enabled = C.LightRed
283 cst['LightBG'].colors.breakpoint_disabled = C.Red
284
285 cst['Neutral'].colors.prompt = C.Blue
286 cst['Neutral'].colors.breakpoint_enabled = C.LightRed
287 cst['Neutral'].colors.breakpoint_disabled = C.Red
288 266
289 267 # Add a python parser so we can syntax highlight source while
290 268 # debugging.
@@ -34,9 +34,10 b' def exception_colors():'
34 34 >>> ec.active_scheme_name
35 35 'NoColor'
36 36 >>> sorted(ec.active_colors.keys())
37 ['Normal', 'caret', 'em', 'excName', 'filename', 'filenameEm', 'line',
38 'lineno', 'linenoEm', 'name', 'nameEm', 'normalEm', 'topline', 'vName',
39 'val', 'valEm']
37 ['Normal', 'breakpoint_disabled', 'breakpoint_enabled', 'caret', 'em',
38 'excName', 'filename', 'filenameEm', 'line', 'lineno', 'linenoEm', 'name',
39 'nameEm', 'normalEm', 'prompt', 'topline', 'vName', 'val', 'valEm']
40
40 41 """
41 42
42 43 ex_colors = ColorSchemeTable()
@@ -70,6 +71,10 b' def exception_colors():'
70 71 "line": C.NoColor,
71 72 "caret": C.NoColor,
72 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 104 "line": C.Yellow,
100 105 "caret": C.White,
101 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 141 "line": C.Red,
133 142 "caret": C.Normal,
134 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 174 "line": C.Red,
162 175 "caret": C.Normal,
163 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 71 Normal = '\033[0m' # Reset normal coloring
72 72 _base = '\033[%sm' # Template for all other colors
73 73
74 # Build the actual color table as a set of class attributes:
75 make_color_table(TermColors)
74 Black = "0;30"
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 103 class InputTermColors:
78 104 """Color escape sequences for input prompts.
General Comments 0
You need to be logged in to leave comments. Login now