[IPython-dev] Curses Frontend

Wendell Smith wackywendell at gmail.com
Thu Mar 4 13:19:45 EST 2010


On 03/04/2010 06:21 PM, Brian Granger wrote:
>  Fantastic, this would be a great addition to IPython!  This comes at
>  a great time.

Thank you for your enthusiasm!

>  Currently, IPython trunk has done away with the old Shell class. Our
>  core class is not iplib.InteractiveShell.  Thus, I would start by
>  looking there.

I have only in the past few weeks started even looking through the 
ipython code, but it was my understanding that 
IPython.core.iplib.InteractiveShell was now the main class - a 
significant difference from before, but still the main class. I've 
noticed as well the Magic class and Application class, but I'm not sure 
I would need to do much with those, except instantiate them, and 
eventually play nicely with the pager/editor/etc. In fact, even with the 
InteractiveShell class, I believe I need to replace the raw_input 
function and Term.cout and Term.cerr, but other than that, I believe 
that I will mainly just have a separate input object that interacts with 
'InteractiveShell' and asks for completions, docstrings, source, etc. as 
it goes.

Anyways, I am starting right now with building objects on top of curses 
- a window that looks like a terminal and accepts terminal escapes and 
scrolls, a scrolling text input box, a pop-up window. I want these to be 
dependent on only curses - while I would make them with curses in mind, 
it makes sense to make these separate; maybe someone will reuse them.

>  * Some of your work will likely be on the IPython core itself.
>  While we have done a lot of work on it you will quickly find areas
>  that need to be updated in order for you to do what you want.  For
>  this part of it, I would simply create a branch on launchpad of the
>  IPython trunk.  This will allow us to merge your work on the IPython
>  core quickly into trunk.

You are probably right, although I do not yet see a need to change 
anything in the core, although, of course, I haven't looked at it that 
deeply nor started in.
And I think I will go on launchpad and branch ipython trunk soon.

>  I think having as clean of a design as possible is best, so I would
>  try to minimize the stuff at the top.  But, the challenge is that
>  some completions and help strings are quite long.  I am not sure how
>  to handle that in a clean way.

As for the design, I liked the idea of a separate text box below for 
input - that seems to make sense to me. There is then the challenge that 
when help strings/etc. pop up, they must, in order of importance, 1) 
avoid the input box, 2) avoid last output, 3) be in an otherwise logical 
position. I thought that perhaps having last output always directly 
above the input box (with blank space on top) would mean that the top 
would always be available for the help/completions/etc. However, I think 
you are right - the completions/help do not need to be there when they 
are blank, so it can just be a pop-up that starts from the top and 
expands downwards as necessary/directed. However... there is much code 
to be written before that is relevant; in the end, the code should make 
it easy to redesign (perhaps config-based) where the pop-ups appear.

Thanks for your help,
Wendell

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20100304/492a8aa6/attachment.html>


More information about the IPython-dev mailing list