[IPython-dev] Improved piping functionality (was: ...dashing for black and white...)

Walter Dörwald walter at livinglogic.de
Fri Jul 14 13:13:32 EDT 2006


Ville Vainio wrote:

> On 7/14/06, Walter Dörwald <walter at livinglogic.de> wrote:
> 
>> BTW, about your proposal to let magic commands return ipipe tables: I
>> tried it with the history and couldn't get it to work. Either the output
>> of magic commands doesn't go through the display hooks, or we have a
>> bootstrapping problem.
> 
> What does _ip.magic("history") return in your case? That certainly
> will go through the display hook...

In [1]: _ip.magic("history")
Out[1]: ['_ip.magic("history")\n']

The strange thing is that with the patched Magic.py none of the ipipe
tables work any more. If I remove all my changes from Magic.py except
the import (from IPython.Extensions import ipipe) it's still broken.
Moving the import into magic_history() fixes the problem.

>> A simplifying solution would be to use the ipipe display functionality
>> for everything not just for tables. I.e. instead of being able to switch
> 
> Sounds a little bit wild, considering that it would eat up generators
> if enabled...

You're right, I think this kill it. Another option would be to never
output anything via an ipipe display unless it's explicitely requested.

With a prefilter hook this could be shortened to one character:
   ils | isort^
would get mapped to
   ils | isort | ipipe.defaultdisplay()

Servus,
   Walter



More information about the IPython-dev mailing list