[IPython-dev] ipipe news

Walter Dörwald walter at livinglogic.de
Wed Mar 1 05:05:41 EST 2006


I've uploaded a new version of ipipe to 
http://styx.livinglogic.de/~walter/IPython/ipipe.py

This should work with the current SVN HEAD of IPython.

The most important changes since the last published version are:

Objects in the curses browser can now be "entered". For example when 
browsing a directory (via "ils"), pressing RETURN on a directory 
displays the content of this directory, pressing RETURN on a file 
displays the text content of that file. Pressing BACKSPACE goes back to 
the previous display. Objects can provide different enter modes (via the 
__xiter__() method), pressing "e" will display a menu of available modes 
(if the object provides any, otherwise it's the same as RETURN).

ipipe now tries to figure out the best way to iterate an object (i.e. 
for dictionaries, modules and multi-line strings it does "the right thing").

Other features added to the browser are: A detail view for the object 
under the cursor, a help screen, customizable key mapping, picking 
current or marked attributes, sorting and entering attributes. (Pressing 
"h" brings up a help screen with the list of all commands.)

One example that shows these new features is browsing sys.modules:

 >>> from ipipe import *
 >>> import sys
 >>> sys.modules | ibrowse

This displays a listing of all loaded modules. Moving the cursor over a 
module (i.e. moving it to the "value" column over e.g. "<module 
'exceptions' (built-in)>") brings up the content of this module, then 
moving the cursor to the value of the __doc__ attribute brings up a 
properly formatted doc string etc.


I think the basic API for this should be pretty stable, so IMHO ipipe 
could go into the current SVN version of IPython, so that people can 
play with it. But of course that's for Fernando and Ville to decide.

Naturally there are probably bugs remaining in the code and of course 
there's always more documentation to write, and I guess a tutorial would 
be pretty useful. And there's probably a whole list of features that 
could be added to the browser (e.g. incremental search would be pretty 
handy) and the pipeline classes.

Anyway, feedback is greatly appreciated!

Bye,
    Walter Dörwald




More information about the IPython-dev mailing list