[IPython-dev] ipython embedded in twisted, no threads
list-ener at strank.info
Mon Apr 16 02:31:27 EDT 2007
[apologies if this arrives twice, posting via gmane didn't work - yet.]
attached is an ugly first attempt at embedding IPython in a twisted
application without using threads.
twisted.internet.stdio and a LineReceiver implementation are responsible
for getting input events.
I had to subclass the IPython shell and rearrange code to
create a non-blocking callback interface (splitting on the main,
blocking, raw_input call).
It's far from perfect: readline functionality is missing (no commandline
navigation, history navigation, completion), and sometimes continuation
lines eat the input counter (In ... In).
Would IPython developers be interested in patches that allow a less ugly
version of such a callback-friendly subclass? ;-)
The basic idea: refactor the main loop (InteractiveShell.interact) to::
(I think it might also be interesting for the frontend to the IPython
parallel computing effort, which uses twisted.)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 13037 bytes
Desc: not available
More information about the IPython-dev