Skip to content

Commit 367b124

Browse files
author
Bob Farrell
committed
Whoosh, I've switched over to an installable package.
Pascal Bleser was kind enough to package bpython for OpenSUSE and sent me a patch to have it working with distutils, which is always nice, so thanks a lot for that, here's the new dir structure. committer: Bob Farrell <bob@keys.(none)>
0 parents  commit 367b124

10 files changed

Lines changed: 3030 additions & 0 deletions

File tree

‎CHANGELOG‎

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
v0.2.4
2+
======
3+
Thanks a lot to Angus Gibson for submitting a patch to fix a problem
4+
I was having with initialising the keyboard stuff in curses properly.
5+
6+
Also a big thanks to John Beisley for providing the patch that shows
7+
a class __init__ method's argspec on class instantiation.
8+
9+
I've fixed up the argspec display so it handles really long argspecs
10+
(e.g. subprocess.Popen()) and doesn't crash if something horrible
11+
happens (rather, it avoids letting something horrible happen).
12+
13+
I decided to add a key that will get rid of the autocomplete window,
14+
since it can get in the way. C-l seemed like a good choice, since
15+
it would work well as a side-effect of redrawing the screen (at
16+
least that makes sense to me). In so doing I also cleaned up a lot
17+
of the reevaluating and resizing code so that a lot of the strange
18+
output seen on Rewind/resize seems to be gone.
19+
20+
v0.2.3
21+
======
22+
The fix for the last bug broke the positioning of the autocomplete
23+
box, whoops.
24+
25+
v0.2.2
26+
======
27+
That pesky bug keeps coming up. I think it's finally nailed but
28+
it's just a matter of testing and hoping. I hate numbers.
29+
30+
v0.2.1
31+
======
32+
I'm having a bit of trouble with some integer division that's
33+
causing trouble when a certain set of circumstances arise,
34+
and I think I've taken care of that little bug, since it's
35+
a real pain in the ass and only creeps up when I'm actually
36+
doing something useful, so I'll test it for a bit and release
37+
it as hopefully a bug fixed version.
38+
39+
v0.2.0
40+
======
41+
A little late in the day to start a changelog, but here goes...
42+
This version fixed another annoying little bug that was causing
43+
crashes given certain exact circumstances. I always find it's the
44+
way with curses and sizing of windows and things...
45+
46+
I've also got bpython to try looking into pydoc if no matches
47+
are found for the argspec, which means the builtins have argspecs
48+
too now, hooray.

‎LICENSE‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License
2+
3+
Copyright (c) 2008 Bob Farrell
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.
22+

‎README‎

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
bpython - A fancy curses interface to the Python interactive interpreter
2+
=======
3+
4+
Dependencies
5+
============
6+
Pygments
7+
pyparsing
8+
(apt-get install python-pyparsing python-pygments)
9+
10+
Introduction
11+
============
12+
A few people asked for stuff like syntax highlighting
13+
and autocomplete for the Python interactive interpreter.
14+
IPython seems to offer this (plus you can get readline
15+
behaviour in the vanilla interpreter) but I tried
16+
IPython a couple of times. Perhaps I didn't really get
17+
it, but I get the feeling that the ideas behind IPython
18+
are pretty different to bpython. I didn't want to create
19+
a whole development environment; I simply wanted to
20+
provide a couple of neat features that already exist
21+
and turn them into something a little more interactive.
22+
23+
The idea is to provide the user with all the features
24+
in-line, much like modern IDEs, but in a simple,
25+
lightweight package that can be run in a terminal
26+
window, so curses seemed like the best choice.
27+
Sorry if you use Windows.
28+
29+
bpython doesn't attempt to create anything new or
30+
groundbreaking, it simply brings together a few neat
31+
ideas and focuses on practicality and usefulness.
32+
For this reason, the "Rewind" function should be
33+
taken with a pinch of salt, but personally I have
34+
found it to be very useful. I use bpython now
35+
whenever I would normally use the vanilla interpreter,
36+
e.g. for testing out solutions to people's problems
37+
on IRC, quickly testing a method of doing something
38+
without creating a temporary file, etc..
39+
40+
I hope you find it useful and please feel free to
41+
submit any bugs/patches (yeah right)/suggestions
42+
to:
43+
robertanthonyfarrell@gmail.com
44+
45+
Features
46+
========
47+
48+
* In-line syntax highlighting.
49+
This uses Pygments for lexing the code as you type,
50+
and colours appropriately. Pygments does a great job
51+
of doing all of the tricky stuff and really leaving
52+
me with very little to do except format the tokens
53+
in all my favourite colours.
54+
55+
* Readline-like autocomplete with suggestions displayed
56+
as you type.
57+
Thanks to Python's readline interface to libreadline
58+
and a ready-made class for using a Python interpreter's
59+
scope as the dataset, the only work here was displaying
60+
the readline matches as you type in a separate curses
61+
window below/above the cursor.
62+
63+
* Expected parameter list.
64+
As in a lot of modern IDEs, bpython will attempt to
65+
display a list of parameters for any function you
66+
call. The inspect module is tried first, which works
67+
with any Python function, and then pydoc if that fails,
68+
which seems to be pretty adequate, but obviously
69+
in some cases it's simply not possible. I used pyparsing
70+
to cure my nested parentheses woes; again, it was
71+
nice and easy.
72+
73+
* Rewind.
74+
I didn't call this "Undo" because I thought that would
75+
be misleading, but "Rewind" is probably as bad. The
76+
idea is that the code entered is kept in memory and
77+
when the Rewind function is called, the last line is
78+
popped and the entire code is re-evaluated. As you can
79+
imagine, this has a lot of potential problems, but for
80+
defining classes and functions, I've found it to be
81+
nothing but useful.
82+
83+
* Pastebin code/write to file.
84+
I don't really use the save thing much, but the pastebin
85+
thing's great. Hit a key and what you see on the screen
86+
will be sent to a pastebin and a URL is returned for you
87+
to do what you like with. I've hardcoded rafb.net/paste
88+
in for now, that needs to be fixed so it's configurable.
89+
Next release, I promise.
90+
91+
* Flush curses screen to stdout.
92+
A featurette, perhaps, but I thought it was worth noting.
93+
I can't personally recall a curses app that does this,
94+
perhaps it's often not useful, but when you quit bpython,
95+
the screen data will be flushed to stdout, so it basically
96+
looks the same as if you had quit the vanilla interpreter.
97+
98+
Known Bugs
99+
==========
100+
101+
* There's some weirdness when you use rewind sometimes with how
102+
it displays the text afterwards, I haven't had enough time to
103+
sit down and look at exactly what's causing it, as it doesn't
104+
seem to happen a lot, and it fixes itself pretty quickly anyway.
105+
106+
* Triple quoted strings over multiple lines work, but they're
107+
not highlighted properly.
108+
109+
* There is no way to configure the keys or the pastebin options,
110+
this is a definite for the next release.

0 commit comments

Comments
 (0)