<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=utf-8">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:70.85pt 70.85pt 70.85pt 70.85pt;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:463274081;
        mso-list-template-ids:1841209042;}
@list l1
        {mso-list-id:719867762;
        mso-list-template-ids:1041795372;}
@list l1:level1
        {mso-level-start-at:2;
        mso-level-tab-stop:36.0pt;
        mso-level-number-position:left;
        text-indent:-18.0pt;}
ol
        {margin-bottom:0cm;}
ul
        {margin-bottom:0cm;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=FR link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>By the way, I send you the last update of the ipython shell.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>You can copy it into Ipython/gui/wx<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>It works better, for example to test if you load the good one,
just type ‘raw_input()’ it will not freeze and will display a box(had a problem
before).<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I have added also an “execute in thread checkbox” to allow
disabling threading is you’re not interested with ctrl+C and want matplotlib
for example.(matplotlib is not compatible with threading currently)<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I have to check how %run works, because all lines must be
executed via </span><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>self.IP.doExecute(lines_to_execute.encode(ENCODING))<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Because it take care of protecting stdin/stdout (that is the
main issue with using ipython0 core).<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>So perhaps we will have to take care of some protection before
calling run magic.<o:p></o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>

<p class=MsoNormal><span lang=EN-US style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Laurent<o:p></o:p></span></p>

<div style='border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt'>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>De :</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> Ronen Abravanel
[mailto:ronena@gmail.com] <br>
<b>Envoyé :</b> dimanche 1 mars 2009 11:11<br>
<b>À :</b> Laurent Dufréchou<br>
<b>Cc :</b> ipython-dev@scipy.org<br>
<b>Objet :</b> Re: [IPython-dev] Ipython plugin for Editra<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'>Hi Laurent,<br>
<br>
My hack attached.<br>
It is mostly defined at "ShellIntegrator" class at the end of the
file.<br>
<br>
The work flow I want to achieve is as  following:<br>
* in Ipython - "%edit myfile.py" or "edit 1:5" etc. Open
editing buffer within the current windows, and returns without running the
file.<br>
* Selectin "Run" from the tool menu in Editra run the buffer, as it
was sopused to run after closing the editor.<br>
<br>
By the way, the plugin have some series stabilty issues. <br>
calling '%run filename.py' for none trevial python file is cusing editra crash
with:<br>
python2.5: ../../src/xcb_lock.c:77: _XGetXCBBuffer: Assertion `((int)
((xcb_req) - (dpy->request)) >= 0)' failed.<br>
Aborted<br>
<br>
<br>
Thanks, <br>
Ronen<o:p></o:p></p>

<div>

<p class=MsoNormal>On Sun, Mar 1, 2009 at 3:33 AM, Laurent Dufréchou <<a
href="mailto:laurent.dufrechou@gmail.com">laurent.dufrechou@gmail.com</a>>
wrote:<o:p></o:p></p>

<div>

<div>

<p><span style='font-size:11.0pt;color:#1F497D'>Hi Ronen,</span><o:p></o:p></p>

<p><span style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Happy to see you’ve
tried to hack the editra plugin ;)</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>IPyShell/__init__.py
contains only the interface with editra. </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>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?</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Is that what you
tried?</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>About the files to
modify. __init__.py in editra plugn is the definition of the plugin interface
and how you interact with editra.</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>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)</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>The fact is that the
update you’re currently trying to di will surely need some update into /gui/wx
I think </span><span lang=EN-US style='font-size:11.0pt;font-family:Wingdings;
color:#1F497D'>L</span><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>.
But well we’ll see.</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>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)</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>(I think we can use
ipython config file but I’ve never used them since then so…)</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>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.</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Sure we will find a
way to workaround the stdin/out issue you saw.</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Send me your current
hack, I’ll take a look at your issue.</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Cheers,</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'>Laurent</span><o:p></o:p></p>

<p><span lang=EN-US style='font-size:11.0pt;color:#1F497D'> </span><o:p></o:p></p>

<div style='border:none;border-left:solid windowtext 1.5pt;padding:0cm 0cm 0cm 4.0pt;
border-color:-moz-use-text-color -moz-use-text-color -moz-use-text-color blue'>

<div>

<div style='border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0cm 0cm 0cm;
border-color:-moz-use-text-color -moz-use-text-color'>

<p><b><span style='font-size:10.0pt'>De :</span></b><span
style='font-size:10.0pt'> <a href="mailto:ipython-dev-bounces@scipy.org"
target="_blank">ipython-dev-bounces@scipy.org</a> [mailto:<a
href="mailto:ipython-dev-bounces@scipy.org" target="_blank">ipython-dev-bounces@scipy.org</a>]
<b>De la part de</b> Ronen Abravanel<br>
<b>Envoyé :</b> samedi 28 février 2009 22:53<br>
<b>À :</b> <a href="mailto:ipython-dev@scipy.org" target="_blank">ipython-dev@scipy.org</a><br>
<b>Objet :</b> [IPython-dev] Ipython plugin for Editra</span><o:p></o:p></p>

</div>

</div>

<div>

<div>

<p> <o:p></o:p></p>

<div>

<p><span lang=EN-US>Editra, an extensible programmer's editor written in
wxPython, contain a cool IPython plugin. </span>This mail is a follow up for a
discussion with <cite>Laurent</cite> , The author of the plugin, in his blog,
continue here according to his request. The Orginal discassion can be found in <a
href="http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/"
target="_blank">http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/</a>
or at the end of this mail.<br>
<br>
<br>
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 <i>ipython_panel.IP._IP.getapi()
</i>) 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.<br>
<br>
<span lang=EN-US>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?)<br>
<br>
<br>
Thanks,<br>
Ronen.<br>
<br>
<br>
</span>--------------------------------------<br>
The orginal discassion:<o:p></o:p></p>

<ol start=1 type=1>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l0 level1 lfo1'><cite>Ronen</cite> Says: <br>
     <span style='font-size:10.0pt'><a
     href="http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/#comment-25"
     target="_blank" title="">February 21, 2009 at 8:18 pm</a> </span><o:p></o:p></li>
</ol>

<p style='margin-left:36.0pt'>That’s a one cool Plugin.<o:p></o:p></p>

<p style='margin-left:36.0pt'>What will make it ideal, is better integration
with Editra’s Editor:<br>
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…<br>
Any hint where should I try to hack in order to achieve those? <o:p></o:p></p>

<p style='margin-left:36.0pt'>Thanks,<br>
Ronen.<o:p></o:p></p>

<ol start=2 type=1>
 <li class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;
     mso-list:l1 level1 lfo2'><b>Erreur ! Nom du fichier non spécifié.</b><cite>Laurent</cite>
     Says: <br>
     <span style='font-size:10.0pt'><a
     href="http://ipython0.wordpress.com/2008/04/25/editra-ipython-plugin-under-work/#comment-26"
     target="_blank" title="">February 22, 2009 at 10:45 am</a> </span><o:p></o:p></li>
</ol>

<p style='margin-left:36.0pt'>Hello,<br>
You can have access to the plugin repos:<o:p></o:p></p>

<p style='margin-left:36.0pt'># Non-members may check out a read-only working
copy anonymously over HTTP.<br>
svn checkout <a href="http://editra-plugins.googlecode.com/svn/trunk/"
target="_blank">http://editra-plugins.googlecode.com/svn/trunk/</a>
editra-plugins-read-only <o:p></o:p></p>

<p style='margin-left:36.0pt'>The plugin name is ipyshell, in it’s directory
you’ve got the whole ipython source + the plugin source.<o:p></o:p></p>

<p style='margin-left:36.0pt'><span lang=EN-US>It need a little refresh for
sure </span><b>Erreur ! Nom du fichier non spécifié.</b><span lang=EN-US>.</span><o:p></o:p></p>

<p style='margin-left:36.0pt'>If you want to try to hack it take a look
@Ipython/gui/wx the whole code is in ipython_view and ipshellnonblocking.<o:p></o:p></p>

<p style='margin-left:36.0pt'>ipython_view -> gui interface<br>
ipshellnonblocking -> the interface with ipython<o:p></o:p></p>

<p style='margin-left:36.0pt'>You can add:<br>
ip = IPython.ipapi.get()<br>
def myEdit(self, arg):<br>
print ‘do what you want’<br>
ip.expose_magic(’edit’, myEdit)<o:p></o:p></p>

<p style='margin-left:36.0pt'>to WxNonBlockingIPShell inside ipython_view.py<o:p></o:p></p>

<p style='margin-left:36.0pt'>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.<o:p></o:p></p>

<p style='margin-left:36.0pt'><span lang=EN-US>We can discuss about all of this
in ipython-dev mailing list </span><b>Erreur ! Nom du fichier non
spécifié.</b><o:p></o:p></p>

<p style='margin-left:36.0pt'>Cheers,<br>
Laurent<o:p></o:p></p>

<p style='margin-bottom:12.0pt'> <o:p></o:p></p>

</div>

</div>

</div>

</div>

</div>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</div>

</div>

</body>

</html>