Show More
@@ -169,28 +169,28 b' def _format_traceback_lines(lines, Colors, has_colors, lvals):' | |||
|
169 | 169 | return res |
|
170 | 170 | |
|
171 | 171 | |
|
172 |
def _format_filename(file, Color |
|
|
172 | def _format_filename(file, ColorFilename, ColorNormal): | |
|
173 | 173 | """ |
|
174 |
Format filename lines with `In [n]` if it's the nth code cell or `File *.py` if it's a module. |
|
|
174 | Format filename lines with `In [n]` if it's the nth code cell or `File *.py` if it's a module. | |
|
175 | 175 | |
|
176 | 176 | Parameters |
|
177 | 177 | ---------- |
|
178 | 178 | file : str |
|
179 |
Color |
|
|
180 | ColorScheme used. | |
|
181 |
Color |
|
|
179 | ColorFilename | |
|
180 | ColorScheme's filename coloring to be used. | |
|
181 | ColorNormal | |
|
182 | 182 | ColorScheme's normal coloring to be used. |
|
183 | 183 | """ |
|
184 | 184 | ipinst = get_ipython() |
|
185 | 185 | |
|
186 | 186 | if ipinst is not None and file in ipinst.compile._filename_map: |
|
187 | 187 | file = "[%s]" % ipinst.compile._filename_map[file] |
|
188 |
tpl_link = "In %s%%s%s" % (Color |
|
|
188 | tpl_link = "In %s%%s%s" % (ColorFilename, ColorNormal) | |
|
189 | 189 | else: |
|
190 | 190 | file = util_path.compress_user( |
|
191 | 191 | py3compat.cast_unicode(file, util_path.fs_encoding) |
|
192 | 192 | ) |
|
193 |
tpl_link = "File %s%%s%s" % (Color |
|
|
193 | tpl_link = "File %s%%s%s" % (ColorFilename, ColorNormal) | |
|
194 | 194 | |
|
195 | 195 | return tpl_link % file |
|
196 | 196 | |
@@ -440,7 +440,7 b' class ListTB(TBTools):' | |||
|
440 | 440 | list = [] |
|
441 | 441 | for filename, lineno, name, line in extracted_list[:-1]: |
|
442 | 442 | item = " %s, line %s%d%s, in %s%s%s\n" % ( |
|
443 |
_format_filename(filename, Colors, Colors. |
|
|
443 | _format_filename(filename, Colors.filename, Colors.Normal), | |
|
444 | 444 | Colors.lineno, |
|
445 | 445 | lineno, |
|
446 | 446 | Colors.Normal, |
@@ -455,7 +455,7 b' class ListTB(TBTools):' | |||
|
455 | 455 | filename, lineno, name, line = extracted_list[-1] |
|
456 | 456 | item = "%s %s, line %s%d%s, in %s%s%s%s\n" % ( |
|
457 | 457 | Colors.normalEm, |
|
458 | _format_filename(filename, Colors, Colors.normalEm), | |
|
458 | _format_filename(filename, Colors.filenameEm, Colors.normalEm), | |
|
459 | 459 | Colors.linenoEm, |
|
460 | 460 | lineno, |
|
461 | 461 | Colors.normalEm, |
@@ -504,7 +504,7 b' class ListTB(TBTools):' | |||
|
504 | 504 | "%s %s, line %s%s%s\n" |
|
505 | 505 | % ( |
|
506 | 506 | Colors.normalEm, |
|
507 | _format_filename(value.filename, Colors, Colors.normalEm), | |
|
507 | _format_filename(value.filename, Colors.filenameEm, Colors.normalEm), | |
|
508 | 508 | Colors.linenoEm, |
|
509 | 509 | lineno, |
|
510 | 510 | Colors.Normal, |
@@ -634,7 +634,7 b' class VerboseTB(TBTools):' | |||
|
634 | 634 | (Colors.vName, Colors.valEm, ColorsNormal) |
|
635 | 635 | tpl_name_val = '%%s %s= %%s%s' % (Colors.valEm, ColorsNormal) |
|
636 | 636 | |
|
637 | link = _format_filename(frame_info.filename, Colors, ColorsNormal) | |
|
637 | link = _format_filename(frame_info.filename, Colors.filenameEm, ColorsNormal) | |
|
638 | 638 | args, varargs, varkw, locals_ = inspect.getargvalues(frame_info.frame) |
|
639 | 639 | |
|
640 | 640 | func = frame_info.executing.code_qualname() |
General Comments 0
You need to be logged in to leave comments.
Login now