Don’t know if anyone is working on pycrust at all anymore (pycrust.sourceforge is proudly announcing the 0.6 release from 2001 still), but I made some changes to my version of pycrust and wondered if there was any interest in them. Basically I’ve haven’t been using python that long, but it seems to me that among the shells I’ve tried pycrust is the best. But it lacks some of the nice features of ipython. I talked to the main fellow behind iPython and he said there is talk about merging ipython and pycrust, but it’s still a long ways off, blah blah blah.
So here’s a summary of the changes I made in no particular order:
-
Made up and down arrows go through history (currently ctrl-up ctrl-down). I don’t see why anyone would want the most common option to be moving the cursor around the screen. Most shells don’t have any way to move the cursor around the screen other than click and drag.
-
Added forward history search (to go with the backward history search bound to F8). Also made the history search default to normal non-search history scrolling if done at the beginning of the line (instead of doing nothing like it used to)
-
Made ctrl-up and ctrl-down do up and down history search (ctrl-up does what F8 does)
-
Added Ctrl-U key combo to erase the current line (like in bash, and like Esc currently does)
-
Modified the about dialog so it doesn’t beep (using ScrolledMessageDialog instead of MessageDialog) (Beep was annoying me)
-
Modified the help dialog so it doesn’t beep (again using ScrolledMessageDialog), and made it actually display the help text rather than telling you to type ‘shell.help()’. (Annoying!)
-
Made exit,close,quit actually quit the shell, after asking if it’s ok, rather than tell you to click on the close box. (also annoying to me ) [incidentally this was done by creating a little helper class whose repr method does the closing. Not sure if this is considered horrible python style or not, but it lets you type just ‘quit’ instead of ‘quit()’.
-
Changed the settings to be saved in $HOME on all platforms if $HOME is set. wx’s GetUserDataDir() ignores $HOME on Windows because it’s not standard, but my opinion is that a lot of programmers do set it, and so, if it’s set, it should be used instead of the standard “Documents and Settings” folder.
-
In my own settings I added a ‘cd’ and ‘ls’ command to navigate the directory structure more easily. These might be nice to have in pycrust itself.
Wishes for further pycrust features that should be relatively easy to add:
- A current directory display, perhaps with history of recently used directoryies. I’m thinking a popdown combobox, like Matlab has.
- A way to change the shell’s font
- A better way to handle magic shell level commands like ‘exit’ or ‘cd’ or ‘ls’. I looked at the interpreter class a bit, but it wasn’t clear right off where the best place to examine commands and “intervene” if they shouldn’t be evaluated by python. It would be nice if you could make those more like unix shell commands. i.e. ‘ls c:\foo’ would work (instead of) “ls(r’c:\foo’)”, and you could get tab completion of filenames etc.
Wishes for things that would be slightly more work:
-
User settable key combos instead of hard coded keys.
-
Debugger integration
Let me know if anyone is interested in these changes and I can post the code. For now I just made copies of the only files I changed (PyCrust.py, crust.py, shell.py, and version.py) and put them in a separate module so that I can have both the original pycrust and my modded version coexisting.
–Bill