[IPython-dev] Editor Syncrhronization

Vivian De Smedt vivian at vdesmedt.com
Tue Jun 3 10:24:29 EDT 2008


Dear All,

Few month ago I wrote a small patch for IPython that synchronize IPython 
and an external text editor or your choice.

When this patch is active IPython call a hook whenever it put highlight 
on a line of code.
Typically when:
- Some script throw an uncatched exception
- We go up and down in the stack in debug mode

I find this useful because it let me
- Use my editor of choice to view and edit large chunk of code and
- Use IPython to debug and analyze the variables.

With the new 0.8.3 release I just patch reapply my patch to 0.8.3 to 
have the functionality and it works well for me.

If someone is interested  by this functionality I'll be glad to submit a 
patch.

The modifications are:
- the definition of a new hook (in hook.py)
- some call to these hook in Debugger.py and in ultraTB.py
- and two exemple of hook in Extentions\ip_synchronize_with_ue.py and in 
Extensions\ip_synchronize_with_nppp.py to synchronize with UltraEdit and 
with Notepad++ respectively.

Note: the Notepad++ hook have a flaw it don't synchronize IPython and 
the text file on the right line if the text file is already opened  in 
the editor (which mean in practice that it synchronize at the correct 
line only the first time). This is a Notepad++ flaw that I'll try to 
solve with the Notepad++ peoples.

To test it simply import ip_synchronize_with_xxx in you ipy_user_conf 
IPyhon configuration.

I'll be glad to have some feedback about this proposition of extension.
If needed I could provide some other implementation of the hook for 
other text processor.

Please tell me what you think about this extension, if you could 
consider it for inclusion in IPython and if so what should I do for that.

Vivian.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: IPython.zip
Type: application/octet-stream
Size: 23598 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20080603/68c2d0f9/attachment.obj>


More information about the IPython-dev mailing list