Hi Jonah,

The problem lies in the actual design, which does not account for
that. There are a number of things to be changed. Probably you want to
start looking at

org.python.pydev.dltk.console.ui.internal.ScriptConsoleDocumentListener.execCommand,
which will create a local callback for onResponseReceived (this is the
place that'll start a command and make it be execute in the python
backend).

Also, in the python backend you'll probably also want to change
pydevconsole.InterpreterInterface.addExec which does the actual exec
to create a Thread to gather the output while things are happening
(note that the command itself must be executed on the main Thread).

If you have more doubts, just ask (I'm not sure if you'll have issues
in the document synchronization for input/output in this case as the
command will be running, so, you should not accept another input while
the current doesn't end).

Cheers,

Fabio

On Sat, Mar 19, 2011 at 10:44 AM, Jonah Graham <jo...@kichwacoders.com> wrote:
> Hello,
>
> I am using PyDev and I would like to implement an improvement to the
> PyDev console related to the asynchonous behaviour.
>
> In particular I want to remove this limitation (from
> http://pydev.org/manual_adv_interactive_console.html)
>
> Limitation: Output is not asynchonous (stdout and stderr are only
> shown after a new command is sent to the console)
>
> A simplified example of what I want to work is:
> for i in range(10): print 'You can see this as it runs', i; time.sleep(0.5)
>
> I had a look through the bug lists and email lists and other than a
> couple of places re-stating that this is a limitation, I couldn't find
> record of why it was a limitation, or what could be done about it.
>
> Before I get too buried in this code, I thought I would ask what the
> issues are. Please feel free to point me at a bug if I have missed it.
>
> Thank you,
> Jonah
>
> ------------------------------------------------------------------------------
> Colocation vs. Managed Hosting
> A question and answer guide to determining the best fit
> for your organization - today and in the future.
> http://p.sf.net/sfu/internap-sfd2d
> _______________________________________________
> pydev-code mailing list
> pydev-code@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/pydev-code
>

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
pydev-code mailing list
pydev-code@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/pydev-code

Reply via email to