[IPython-dev] Ipython plugin for Editra
laurent.dufrechou at gmail.com
Sat Feb 28 20:33:51 EST 2009
Happy to see you’ve tried to hack the editra plugin ;)
IPyShell/__init__.py contains only the interface with editra.
I do not cleanly understand the step your are trying to do. You’ve used ” %ed” than it launched editra new source panel? And closing it executed your code, but stdin/out goes outside ipython shell?
Is that what you tried?
About the files to modify. __init__.py in editra plugn is the definition of the plugin interface and how you interact with editra.
Ipython dir is a pure copy that I was used to upload from time to time. I have to take a look at some updates that cody did. (some compatibility issue with python 2.6 and ipython tree)
The fact is that the update you’re currently trying to di will surely need some update into /gui/wx I think L. But well we’ll see.
Depending on what you’ll want to do we will perhaps expose some methods so plugin will be able to configure the things you need. (ex being able to define an editor)
(I think we can use ipython config file but I’ve never used them since then so…)
I will try to upload updated sources for python tree tomorrow, so you’ll have a bleeding edge wx integration. I’ve corrected some bugs since then.
Sure we will find a way to workaround the stdin/out issue you saw.
Send me your current hack, I’ll take a look at your issue.
De : ipython-dev-bounces at scipy.org [mailto:ipython-dev-bounces at scipy.org] De la part de Ronen Abravanel
Envoyé : samedi 28 février 2009 22:53
À : ipython-dev at scipy.org
Objet : [IPython-dev] Ipython plugin for Editra
Editra, an extensible programmer's editor written in wxPython, contain a cool IPython plugin. This mail is a follow up for a discussion with Laurent , The author of the plugin, in his blog, continue here according to his request. The Orginal discassion can be found in http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/ or at the end of this mail.
Using papi to set\redefine IPython's magic word partly do the job, The other part is to execute some arbitrary python code inside The ipython shell. Invoking papis "ex" method (Using papi from ipython_panel.IP._IP.getapi() ) let the Code run in IPython's context, but the output is printed to Editra's stdout (The console in wich I invoked editra's from) and not in the IPython in the shelf. My attempts to set sys.stdout to an handler from, let say, _term.cout or others, cused IPython to stack. futher more, the Exeption throws while I call ip.ex, is cought within Editra and withn IPython.
Further more - I wish to change, If I can, Only IPyShell/__init__.py and not the stuff in "IPython" dir, as it seems as a "pure" copy of IPython's orginal source (is it?)
The orginal discassion:
1. Ronen Says:
February 21, 2009 at 8:18 pm <http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/#comment-25>
That’s a one cool Plugin.
What will make it ideal, is better integration with Editra’s Editor:
Make ipython’s %edit Open the edit-buffer in Editra’s current Windows, and Enable poeple to run The code they edit in Editra inside the open IPython windows…
Any hint where should I try to hack in order to achieve those?
2. <http://1.gravatar.com/avatar/7d4c274b8ecba154d3ee55838145bb23?s=32&d=identicon> Laurent Says:
February 22, 2009 at 10:45 am <http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/#comment-26>
You can have access to the plugin repos:
# Non-members may check out a read-only working copy anonymously over HTTP.
svn checkout http://editra-plugins.googlecode.com/svn/trunk/ editra-plugins-read-only
The plugin name is ipyshell, in it’s directory you’ve got the whole ipython source + the plugin source.
It need a little refresh for sure :) <http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif> .
If you want to try to hack it take a look @Ipython/gui/wx the whole code is in ipython_view and ipshellnonblocking.
ipython_view -> gui interface
ipshellnonblocking -> the interface with ipython
You can add:
ip = IPython.ipapi.get()
def myEdit(self, arg):
print ‘do what you want’
to WxNonBlockingIPShell inside ipython_view.py
Please note that if ipython is ever installed on your system you’ll have to make a eggsetup.py develop to make sure to use your new local copy.
We can discuss about all of this in ipython-dev mailing list :) <http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the IPython-dev