Skip to content

Commit e6c7573

Browse files
pretty autocomplete box and some py3 changes
--HG-- branch : scroll-frontend
1 parent 19d90c9 commit e6c7573

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

bpython/scrollfrontend/replpainter.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def matches_lines(rows, columns, matches, current, config):
3939
return []
4040
color = func_for_letter(config.color_scheme['main'])
4141
max_match_width = max(len(m) for m in matches)
42-
words_wide = max(1, (columns - 1) / (max_match_width + 1))
42+
words_wide = max(1, (columns - 1) // (max_match_width + 1))
4343
matches_lines = [fmtstr(' ').join(color(m.ljust(max_match_width))
4444
if m != current
4545
else highlight_color(m) + ' '*(max_match_width - len(m))
@@ -67,10 +67,10 @@ def paint_infobox(rows, columns, matches, argspec, match, docstring, config):
6767
# add borders
6868
width = min(columns - 2, max([len(line) for line in lines]))
6969
output_lines = []
70-
output_lines.append('+'+'-'*width+'+')
70+
output_lines.append(u'┌'+u'─'*width+u'┐')
7171
for line in lines:
72-
output_lines.append('|'+((line+' '*(width - len(line)))[:width])+'|')
73-
output_lines.append('+'+'-'*width+'+')
72+
output_lines.append(u'│'+((line+' '*(width - len(line)))[:width])+u'│')
73+
output_lines.append(u'└'+u'─'*width+u'┘')
7474
r = fsarray(output_lines[:rows])
7575
assert len(r.shape) == 2
7676
#return r

bpython/scrollfrontend/sitefix.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
""""""
22
import sys
33

4+
from bpython._py3compat import py3
5+
46
def resetquit(builtins):
57
"""Redefine builtins 'quit' and 'exit' not so close stdin
68
@@ -12,4 +14,4 @@ def __call__(self, code=None):
1214

1315
def monkeypatch_quit():
1416
if 'site' in sys.modules:
15-
resetquit(sys.modules['__builtin__'])
17+
resetquit(sys.modules['builtins' if py3 else '__builtin__'])

0 commit comments

Comments
 (0)