Skip to content

Commit 1cc52aa

Browse files
committed
fix stupid bug (called str.upper instead of str.isupper to check upper case)
and add light.theme to distribution
1 parent 70f28ea commit 1cc52aa

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

bpython/cli.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1109,7 +1109,7 @@ def echo(self, s, redraw=True):
11091109

11101110
a = curses.color_pair(int(col_num) + 1)
11111111
s = re.sub('\x01[A-Za-z][A-Za-z]?', '', s)
1112-
if fg.upper():
1112+
if fg.isupper():
11131113
a = a | curses.A_BOLD
11141114
s = s.replace('\x03', '')
11151115
s = s.replace('\x01', '')
@@ -1735,7 +1735,7 @@ def settext(self, s, c=None, p=False):
17351735

17361736
if s:
17371737
if self.c:
1738-
self.win.addstr(s, curses.color_pair(self.c))
1738+
self.win.addstr(s, self.c)
17391739
else:
17401740
self.win.addstr(s)
17411741

@@ -1769,7 +1769,7 @@ def init_wins(scr, cols):
17691769
#
17701770
statusbar = Statusbar(scr, main_win,
17711771
".:: <C-d> Exit <C-r> Rewind <F2> Save <F8> Pastebin ::.",
1772-
cols[OPTS.color_scheme['main']] + 1)
1772+
get_colpair('main'))
17731773

17741774
return main_win, statusbar
17751775

light.theme

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Each letter represent a colour marker: k, r, g, y, b, m, c, w
2+
# which stands for: blacK, Red, Green, Yellow, Blue, Magenta,Cyan, White
3+
# Capital letters makes bold fonts
4+
# Copy to ~/.bpython/foo.theme and set "color_scheme = foo" in ~/.bpython.ini
5+
6+
[syntax]
7+
keyword = M
8+
name = r
9+
comment = b
10+
string = g
11+
error = r
12+
number = B
13+
operator = c
14+
punctuation = b
15+
token = g
16+
other = b
17+
18+
[interface]
19+
background = w
20+
output = b
21+
main = b
22+
prompt = r
23+
prompt_more = g

0 commit comments

Comments
 (0)