Skip to content

Commit 90a5ab8

Browse files
author
Bob Farrell
committed
Now 2.4-compatible.
As far as I know this should run fine on 2.4 without any problems. Thanks a bunch to Seamus for making me have to write ugly code to make bpython compatible with his computer from the 1800s. committer: Bob Farrell <bob@keys.(none)>
1 parent f744de3 commit 90a5ab8

2 files changed

Lines changed: 20 additions & 3 deletions

File tree

‎CHANGELOG‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
v0.6.0
2+
======
3+
No noticeable changes except that bpython should now work with
4+
Python 2.4. Personally I think it's silly to make a development
5+
tool work with an out of date version of Python but some people
6+
seem to disagree. The only real downside is that I had to do a
7+
horrible version of all() using reduce(), otherwise there's no
8+
real differences in the code.
9+
110
v0.5.3
211
======
312
Now you can configure a ~/.bpythonrc file (or pass a rc file at the

‎bpython.py‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,10 @@ def show_list( self, items, topline=None ):
409409
y, x = self.scr.getyx()
410410
h, w = self.scr.getmaxyx()
411411
down = (y < h / 2)
412-
max_h = h - y if down else y+1
412+
if down:
413+
max_h = h - y
414+
else:
415+
max_h = y+1
413416
max_w = int(w * 0.6)
414417

415418
self.list_win.erase()
@@ -1060,7 +1063,9 @@ def strbase( self, l ):
10601063

10611064
sl = sorted( l, key=str.__len__ )
10621065
for i, c in enumerate( l[-1] ):
1063-
if not all( k.startswith( l[-1][:i] ) for k in sl ):
1066+
if not reduce( lambda x, y: (x and y) or False,
1067+
( k.startswith( l[-1][:i] ) for k in sl ),
1068+
True ):
10641069
break
10651070

10661071
return l[-1][:i-1]
@@ -1434,6 +1439,9 @@ def loadrc():
14341439
if hasattr( OPTS, k ):
14351440
setattr( OPTS, k, v )
14361441

1442+
if not "pyparsing" in sys.modules:
1443+
OPTS.arg_spec = False
1444+
14371445
stdscr = None
14381446

14391447
def main( scr ):
@@ -1478,7 +1486,7 @@ def main( scr ):
14781486
o = curses.wrapper( main )
14791487
except:
14801488
tb = traceback.format_exc()
1481-
finally: # I don't know why this is necessary; without it the wrapper doesn't always
1489+
# I don't know why this is necessary; without it the wrapper doesn't always
14821490
# do its job.
14831491
if stdscr is not None:
14841492
stdscr.keypad(0)

0 commit comments

Comments
 (0)