[IPython-user] ipython1.frontend status

Johann Cohen-Tanugi cohen@slac.stanford....
Thu Jun 5 01:52:47 CDT 2008

delegation vs subclassing : vast topic! You can google it :) I do not 
know about this particular case but typically one uses delegation in 
order to protect the client code from inheriting undesired methods of 
the parent class. So typically, class A has a private member of type 
class B and class A implements methods that calls specific methods of 
the private member, so that other undesirable methods of class A remain 
hidden (sorry for the C++ vocabulary here). If class A is a natural 
particular case of class B, then subclassing is usually more elegant, 
because more in synch with conceptual thinking.

Laurent Dufréchou wrote:
> Hello barry,
> We want screenshots! ^_^
> Don't see if you saw my previous mail but i'm really interested in 
> your work because of the ipython1 compatibility + remote execution.
> Here are two questions:
> -Do you support ctrl+c (break in a loop)?
> -Do you support in loop stdout?:
> I mean:
> If (1):
>      print "hello"
> Does it display lot of hello WHILE executing the loop?
> -Do you support completion (althought it is not really important, 
> 'cause must be easy no?)
> If not, do you see any problem to implement this? I ask this because 
> it was the hardest things i had to implement on my wx frontend.
> And I want to be sure before switching ot ipython1 core not to loose 
> these important features.
> By the way, can you explain me difference between 'I wrote a delegate 
> for the
> NSTextView' and subclassing? (sorry)
> Laurent
> 2008/6/5 Barry Wark <barrywark@gmail.com <mailto:barrywark@gmail.com>>:
>     Hi all,
>     Following discussion of the last couple days, I thought I'd update
>     folks on the status of ipython1.frontend in the ipython1-cocoa branch.
>     I've made a first stab at the frontend.frontendbase module and have
>     implemented a bare-bones Cocoa frontend for ipython1. I subclassed
>     Cocoa's text view widget (well, actually I wrote a delegate for the
>     NSTextView, but it could have been done as a subclass) and also
>     subclassed frontend.frontendbase.FrontEndBase. Besides the code to
>     handle the appropriate events/text layout etc. which are specific to
>     Cocoa, my Cocoa frontend required about 200 lines of code. I think
>     it's a pretty good start for similar endeavors in Qt or Wx etc.
>     One issue that's come up is that the deferred result
>     ipython1.kernel.engineservice.EngineService.execute has a string
>     representation of the block's output (in result['display']['pprint']),
>     but there's no way to get the actual python object that generated that
>     string. This prevents the frontend from e.g. rendering an image result
>     inline. I realize this is because the engine may be remote, but in the
>     case of (1) serializeable objects or (2) local engines, it seems that
>     we might want to add an option to execute to return the actual result
>     as well as its pprint/repr...
>     Barry
>     _______________________________________________
>     IPython-user mailing list
>     IPython-user@scipy.org <mailto:IPython-user@scipy.org>
>     http://lists.ipython.scipy.org/mailman/listinfo/ipython-user
> -- 
> Laurent Dufrechou
> Hardware Engineering
> Marport
> 16 Blv Abbé Louis LE CAM
> 56100 Lorient
> Tél : +33(0)635028304
> Fax : +33(0)297884812
> ------------------------------------------------------------------------
> _______________________________________________
> 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