Skip to content

Commit 08c5b26

Browse files
committed
fix traceback colour not being customisable and (hopefully) improve light
colour scheme
1 parent b29283b commit 08c5b26

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

bpython/cli.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ def make_colours():
151151
'prompt': 'r',
152152
'output': 'k',
153153
'statusbar': 'r',
154+
'error': 'b',
154155
}
155156
OPTS.dark = {
156157
'listwin': 'c',
@@ -166,6 +167,7 @@ def make_colours():
166167
'prompt': 'g',
167168
'output': 'w',
168169
'statusbar': 'c',
170+
'error': 'y',
169171
}
170172
if OPTS.color_scheme == 'light':
171173
bg = 7
@@ -274,7 +276,7 @@ def showtraceback(self):
274276
def writetb(self, l):
275277
"""This outputs the traceback and should be overridden for anything
276278
fancy."""
277-
map(self.write, ["\x01y\x03%s" % (i, ) for i in l])
279+
map(self.write, ["\x01%s\x03%s" % (OPTS.extras['error'], i) for i in l])
278280

279281

280282
class Repl(object):

bpython/formatter.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,20 +71,20 @@
7171
}
7272

7373
f_strings_light = {
74-
Keyword: "\x01b",
75-
Name: "\x01k\x02",
76-
Comment: "\x01b",
74+
Keyword: "\x01y\x02",
75+
Name: "\x01k",
76+
Comment: "\x01g\x02",
7777
String: "\x01g",
7878
Error: "\x01r",
7979
Literal: "\x01r",
80-
Literal.String: "\x01g",
80+
Literal.String: "\x01b\x02",
8181
Token.Literal.Number.Float: "\x01g\x02",
8282
Number: "\x01g",
8383
Operator: "\x01b\x02",
8484
Operator.Word: "\x01k\x02",
8585
Punctuation: "\x01b\x02",
8686
Generic: "\x01d",
87-
Token: "\x01b",
87+
Token: "\x01r\x02",
8888
Whitespace: "\x02d",
8989
}
9090

0 commit comments

Comments
 (0)