cjprecord / editra-plugins

Automatically exported from code.google.com/p/editra-plugins
0 stars 0 forks source link

[launch] Add IPyShell Option to launch to open an IPyShell after launching #84

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What Plugin does this relate to? What version of the Plugin?
Launch-0.9-py2.5

Add an 'ipython' option to launch python scripts with ipython or make it at
least possible to embed an ipshell.
If you now embed an IPython.Shell.IPShellEmbed into your program it does
not work with the Launch Plugin (I think its because of the control
characters).

Another way would be to make it easier to add own launch options (ie I
would also like to add an epydoc launcher to validate my docstrings).

Original issue reported on code.google.com by jug4andr...@googlemail.com on 25 Jan 2009 at 11:55

GoogleCodeExporter commented 9 years ago
Hello,

You should already be able to use epydoc by adding it in the launch config 
dialog
options for python files.

see: http://editra.org/launch_overview

If you have an IPyShell embedded in the program you are launching it should 
work.
What kind of issues are you seeing?

Cody

Original comment by CodyPrec...@gmail.com on 25 Jan 2009 at 5:51

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
> You should already be able to use epydoc by adding it in the launch config 
dialog
> options for python files.
>
> see: http://editra.org/launch_overview

Ah, cool. That's exactly what I searched for. Didn't noticed that there was a 
button :)

> If you have an IPyShell embedded in the program you are launching it should 
work.
> What kind of issues are you seeing?

The control characters are displayed incorrectly and it exits directly:

In [1]: 
Do you really want to exit ([y]/n)? 
>>> Exit Kode: 0

Original comment by jug4andr...@googlemail.com on 26 Jan 2009 at 12:41

GoogleCodeExporter commented 9 years ago
Hello (Laurent), you still out there?

Any idea what this issue is or if this is something that IPyShell can/does 
support?

Thanks,

Cody

Original comment by CodyPrec...@gmail.com on 26 Jan 2009 at 6:35

GoogleCodeExporter commented 9 years ago
Hi cody :)
Still there! Just sleeping a little ;)

>> If you have an IPyShell embedded in the program you are launching it should 
work.
>> What kind of issues are you seeing?
>
>The control characters are displayed incorrectly and it exits directly:
>
>
>In [1]: 
>Do you really want to exit ([y]/n)? 
>>>> Exit Kode: 0

Can explain me what you are trying to do ?_?
I haven't understood what is the process...

Can you tell me what are the exact step to reproduce this ?

What I understood is that you wanted to launch a script calling ipython instaed 
of
python. So I think it is not related to ipyshell. If you want to send your 
script via
ipython instead of python, do you have the same effect with command line 
(outside
editra)?

Regards,
Laurent

(Looking at youe ttle you want to launch a script from ipyshell? is that that?)

Original comment by laurent....@gmail.com on 26 Jan 2009 at 6:46

GoogleCodeExporter commented 9 years ago
Ok just seen what you are saying.
I'm on it.

Original comment by laurent....@gmail.com on 26 Jan 2009 at 7:00

GoogleCodeExporter commented 9 years ago
Oups :)
Forget my last mail!!!
I was playing with ipyshell, and a stupid ctrl+v made the discussion appears on 
the
shell, was thinking it was the bug!! Sorry.
Please explan better how to reproduce will try to reproduce and will try to fix.
Sorry!

Original comment by laurent....@gmail.com on 26 Jan 2009 at 7:04

GoogleCodeExporter commented 9 years ago
Hello!
I want to have a ipyshell after launching my script to access the variables and
objects defined in the script (for debugging/testing). To achieve that, there 
are 2 ways:
1) Execute the program with ipython
2) Embed the shell into the program (see
http://ipython.scipy.org/doc/manual/html/interactive/reference.html#embedding)

Both end like I wrote before. I think it's because ipython uses terminal control
characters and expects a terminal to display them. Further, I don't know what 
would
be easier: Make this work with the launch plugin or hack it into the ipyshell 
plugin.

Regards,
Julian

Original comment by jug4andr...@googlemail.com on 26 Jan 2009 at 7:04

GoogleCodeExporter commented 9 years ago
Ok I see now :)
> Both end like I wrote before. I think it's because ipython uses
> terminal
> control
> characters and expects a terminal to display them.

That's exactly the problem.
I've tried before to use the same trick but is has never worked for me :(

I see two other way to do this:
-1) start an ipyshell (so you'll get an ipython shell)
Inside do "ls your working directory"
Then %run script.py

>> problems: will be limited to non wx features. If you use matplotlib ,
disable threading support.
>> you will found perhaps some bugs I've never seen ;)

-2) launcher, is it possible to launch a command without redirecting stdin
stdout?
I mean something like (under windows) launch a cmd prompt and then launch
ipython myscript.py inside it?
Cody can launcher do that? If I remember well SPE had an option like this,
so it could also call winpdb from it's GUI. So the launcher invocked winpdb
outside the editor. Same for python shell.(Was quite usefull in fact ;) )

We can also try to make a connection between launcher and the ipyshell.
I can add a function call, something like:
Ipython_execute(string) that will run 'ls "current_path"\n%run string'.
But first I need to know if solution sems ok for you :)

Original comment by laurent....@gmail.com on 26 Jan 2009 at 9:40

GoogleCodeExporter commented 9 years ago
Hello,

The Launch plugin is very generic and general case. It has api for allowing 
custom 
handling of different filetypes to handle their error output but out side of 
that it 
does not do much more than manage different command line calls and reading from 
stdout/stderr. The view is also Read Only, it does not allow for interactive 
input.

This plugin will remain that way, if there is a need for some sort of special 
case 
handling like this it will need to be either handled by a specialized plugin or 
by 
IPyShell.

As a possible workaround you could have the logic for doing this in the python 
script you are trying to launch. When Launch runs it it creates a separate 
process 
so you should be able to do anything you would when its run standalone.

i.e) You could write a generic script that takes another script to run as an 
argument then just wrap the calls to ipython within it. (* Disclaimer: I 
haven't 
used ipython other than trying out this plugin so I don't know much about it *)

myLaunchScript.py myScriptToLaunch.py

Cody

Original comment by CodyPrec...@gmail.com on 26 Jan 2009 at 9:55

GoogleCodeExporter commented 9 years ago
closing as wont fix

Original comment by CodyPrec...@gmail.com on 3 Sep 2009 at 3:36