92 Commits

Author SHA1 Message Date
Bob Farrell 03fa87151d pyparsing backward compatibility magic
"printables" doesn't seem to be available in some older versions of
pyparsing so I've put it in myself instead.
2008-06-27 16:10:36 +01:00
Bob Farrell 2f3f7b63d0 stdout faking improved
Now bpython doesn't go wrong if you do, e.g.:
print "abc", "def", "ghi"

I was handling stdout faking in a really peculiar way, for some reason.
Now I don't and it works fine, go figure.
2008-06-25 19:53:32 +01:00
Bob Farrell 2f300db252 help() now works just the same as vanilla help() 2008-06-25 17:49:47 +01:00
Bob Farrell 810e1327c2 All columns in list window now used fully
No idea how I didn't notice this one sooner; I think it was just there
in my periphery and I got used to it and forgot it was actually there,
but now the rightmost column gets fully used. I also fixed another
couple of little bugs that don't come up very often.
2008-06-24 23:54:27 +01:00
Bob Farrell b5f24287e4 pyparsing import cleaned up
An ImportError was being raised for pyparsing even if it was being
partly successfully imported which may have caused problems in other
places.
2008-06-24 20:57:58 +01:00
Bob Farrell d8c51fc580 Added insult to Seamus for being a dickhead. 2008-06-24 19:29:44 +01:00
Bob Farrell b2226509f0 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.
2008-06-24 19:16:29 +01:00
Bob Farrell 760aa7aa47 setup.py updated 2008-06-24 18:08:24 +01:00
Bob Farrell fe4b4fc988 sample-rc included with package 2008-06-24 18:07:49 +01:00
Bob Farrell 3382036844 Screwed up my commit.
Oops, messed up a little. Hopefully everything's okay. I moved
internal.py to _internal.py so it isn't cluttering the namespace so
much, and also I forgot to mention that I wrote a config parser using
shlex so you can set any attribute of the OPTS object now, e.g.

auto_display_list
syntax
arg_spec
2008-06-24 17:39:53 +01:00
Bob Farrell 93ad83025b Fixed the pager and help so the full help is displayed
Also added a 'q' option to the pager to cancel out of huge help pages.
2008-06-24 17:33:32 +01:00
Bob Farrell ad410584c9 My homie Brendogg axed me for manual display of the completion window
Now there's an option to require hitting tab to display the completion
window instead of having it pop up automatically as you type. You need
to edit the source at the moment (change OPTS.auto_display_list), the
next commit should have config file support.
2008-06-24 16:18:19 +01:00
Bob Farrell 2f6555bfd2 help() fixed up so it's internalised
A few people pointed out that help() can cause problems, specifically
when the help string is really big, so I've internalised it and injected
my own help() function into the interpreter which pages the output, but
it's pretty ghetto so I'm open to suggestions for improvement.

That said, it's pretty obvious that scrolling up and down (like less)
would be the main requested improvement so I should get to work on that
at some point.
2008-06-21 18:55:31 +01:00
Bob Farrell 414b8a3daf Unprintable character handling fix
Things like C-p and C-n and all that were just being echoed as ^P, and
only one character was being put into the buffer, whereas two were being
echoed. Now only printable characters are accepted for regular input.
2008-06-18 23:36:10 +01:00
Bob Farrell a497cca157 Sizing of autocomplete window yet again fixed!
I hate this kind of stuff; I'm pretty bad at it. But I think I've made
it more stable now.
2008-06-18 23:30:57 +01:00
Bob Farrell 25e8ccac4c PYTHONSTARTUP actually works now.
I didn't have a chance to test the code I put in before committing but I
gave it a test run now, it seems to work fine.
2008-06-17 15:03:17 +01:00
Bob Farrell ea096115cd close() also implemented for same hacky fix as flush()
The logging module tries to call both these methods, so I'm sure other
modules do as well.
2008-06-16 23:28:48 +01:00
Bob Farrell 7aa6db358c I cited the scapy module as being the cause of a problem, it wasn't.
It was actually a problem in the logging module.
2008-06-16 23:22:29 +01:00
Bob Farrell a5fce828f3 PYTHONSTARTUP variable is no longer ignored
Olivier Grisel pointed out that bpython ignores the PYTHONSTARTUP
variable. I never used it but the code was simple enough, cited here:
http://docs.python.org/tut/node4.html#startup

It's not much code at all, but let me know if it breaks anything (I
don't see why it should).
2008-06-16 22:40:55 +01:00
Bob Farrell 72376f7790 scapy expecting file-like methods that don't exist
scapy seems to have a bug in it in that it expects stdout to have a
flush() method, which is not specified in the documentation for the sys
module (it specifies that it requires only a write() method to be
acceptable). So this is a hack to fix it, it's harmless though.
2008-06-16 22:37:01 +01:00
Bob Farrell 85d6485565 Escape key handling fix
Ben Ford pointed out that the escape key can cause things to go a little
awry, I've fixed that and added another fix for potential breakage that
hadn't come up before.
2008-06-16 22:09:23 +01:00
Bob Farrell 596a76e86f No more crashing on stupidly long entries in the autocomplete list
Thanks to habnabit for using lame modules that uncovered this one.
2008-06-14 17:15:41 +01:00
Bob Farrell 1b92cbe871 Just a changelog update, nothing important. 2008-06-12 18:22:23 +01:00
Bob Farrell b509d11833 I've finally managed to fix up the list drawing stuff.
If it isn't actually fixed in this release then it will be soon as I
have (hopefully) done it in a much more intelligent way than it was
before. I haven't tested it thoroughly yet (no matter how hard I try
there always seems to be one that gets away every time) so I'll just use
it as it is and cross my fingers. :-)
2008-06-12 17:34:04 +01:00
Bob Farrell 8e7a267135 Really long members (haha) were causing trouble for completion, thanks habnabit.
The completion suggestions would cause a crash if one of them was too long, this is now fixed.
2008-05-03 02:01:46 +01:00
Bob Farrell b0b1caf043 Words needed an extra space between them so they don't squish together
Sorry about that.
2008-05-03 01:00:17 +01:00
Bob Farrell 032d0c439a Added a little optimisation to the new algo
Not really going to make a huge difference but it wasn't exactly
a great deal of work.
2008-05-03 00:51:55 +01:00
Bob Farrell 7a1efba043 Finally! The suggestions window works without breaking.
I actually sat down and did maths, and it worked! Whoosh.
2008-05-03 00:42:26 +01:00
Bob Farrell 45e44807fa dksaldasd 2008-04-30 18:48:21 +01:00
Bob Farrell 8c00dfd996 Whoops, DEBUG() calls left lying about again... 2008-04-30 16:07:08 +01:00
Bob Farrell bd6bc766a6 Entities with huge numbers of attributes were causing big problems
Thanks to Aaron Gallagher (habnabit) for pointing this one out. The code
had been bugging me for a while with its potential for huge inefficiency,
the way it works now should be much, much faster.
2008-04-30 16:04:30 +01:00
Bob Farrell b509791910 expanduser more correct
Now it checks if fn.startswith('~'), rather than checking if there's a ~
in the string at all.
2008-04-29 02:05:24 +01:00
Bob Farrell 8421581d96 Tab stuff is much better now.
I added a thing so you can hit C-Backspace to go to the beginning
of the line, and then I figured I should actually handle tabs
properly, so that's what it does now. Hooray. I think it might
break on other computers, oh well, too late now.
2008-04-28 23:41:22 +01:00
Bob Farrell f96cb91cd3 ... and forgot to update the version number for setup.py ... 2008-04-28 16:40:42 +01:00
Bob Farrell 83b91a7acc Forgot the CHANGELOG... 2008-04-28 16:36:54 +01:00
Bob Farrell b7315c3928 Improved the autoindent stuff
The autoindent should work now with multiple levels of indenting.
e.g.:
def foo():
	def bar():
		def baz():
			print "hi"
			print "ho"
2008-04-28 16:34:23 +01:00
Bob Farrell 72ac830f04 os.path.expanduser() fixed
Thanks to Klaus Alexander Seis for the patch for this one.
2008-04-28 16:20:31 +01:00
Bob Farrell 5c84feb9db Auto-indent added
It was pretty trivial (it just autoindents if a line ends with a colon
or if the previous line was indented).
2008-04-28 15:33:27 +01:00
Bob Farrell 54f4f9fa27 Whoops, I'd left a DEBUG() call in there.
Sorry about that.
2008-04-27 23:56:45 +01:00
Bob Farrell dec6a17824 Tab completion suggestions no longer have pointless repetition
The suggestions for, e.g. foo.bar. would include "foo.bar." in
every suggestion, and it seemed like a pretty pointless waste of
space, especially for a curses app.
2008-04-27 23:43:00 +01:00
Bob Farrell c4089f5cec Class __init__ spec lookup fixed on classes with no __init__
The AttributeError wasn't being caught on the lookup, which is now fixed.
2008-04-27 23:23:22 +01:00
Bob Farrell 7a1ebadb52 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.
2008-04-27 22:05:23 +01:00