[IPython-user] ipython1-cocoa branch

Brian Granger ellisonbg.net@gmail....
Thu Mar 20 17:37:26 CDT 2008


Barry,

Here are some comments and questions about the great cocoa frontend:

1) I think we might be able to get rid of the InteractiveEngineService
class.  We have been planning for the EngineService itself to have all
of the core interactive method s like `complete`.  So, I think we can
move `complete` to the regular EngineSevice class.  This will keep
things simple.

2) feed_block.  I am not sure that I like the idea of having
feed_block in the Interpreter and EngineService classes.  I don't
remember how they got there.  But, here is my thinking on this.
feed_block is seems like a remnant from IPython0, where each line is
compiled one by one to determine the prompts.  But, IPython1 is not
setup this way.  It doesn't and can't really know about prompts (that
is fort the frontend to handle) and it is not line oriented.  Instead,
it is block oriented.  By this, I mean it is up to the frontend to
pass a block of python code to the Engine/Interpreter - it simply take
the block, compiles it and runs it.

One thing to keep in mind is that the Engine may be busy (running user
code) when you try to call feed_block to figure out the right prompt
in the frontend.  Because of this, I think all prompt decisions need
to be made by the frontend without calling into the Engine.  There are
some exceptions to this, but overall, this is how we have designed
things.  But, I think we probably need to have a bigger discussion
with everyone else on this issue.

3) It looks like you are using the ThreadedEngineService.  What is the
reason for this?  I am just wondering if we need to think about where
to put the threading stuff.  It might make sense to have in the actual
Interpreter, but I am not sure.  What are your thoughts on this?

4) Another route would have been to skip using the EngineService stuff
and Twisted and just use the actual Interpreter object (which we could
add threads to ?).  Do you think it makes more sense to use Twisted
and the EngineService like you have done?  Not sure what you think
about this.

Cheers,

Brian

4)


On Thu, Mar 13, 2008 at 1:59 AM, Barry Wark <barrywark@gmail.com> wrote:
> I've created an ipython1-cocoa branch on launchpad.net for developing
>  the cocoa frontend for ipython1. It adds an IEngineInteractive
>  interface and InteractiveEngine implementation (as well as associated
>  tests) to ipython1.kernel.engineservice as well as
>  ipython1.frontend.cocoa.cocoa_frontend and tests.
>  ipython1.frontend.cocoa.cocoa_frontend contains a Cocoa wrapper for
>  InteractiveEngine and a delegate to turn an NSTextView (the standard
>  text view in Cocoa) into an interactive terminal-style prompt for the
>  InteractiveEngine service. The ipython1.frontend.cocoa.examples
>  directory contains an XCode project of an app that uses the frontend
>  to provide an interactive prompt and namespace display.
>
>  I propose this as a starting point for a cocoa frontend for ipython1.
>  The only potentiall sticky points are the additions to
>  ipython1.kernel.engineservice. Please let me know what y'all think.
>
>  Barry
>  _______________________________________________
>  IPython-user mailing list
>  IPython-user@scipy.org
>  http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
>


More information about the IPython-user mailing list