diff --git a/IPython/Extensions/ipy_editors.py b/IPython/Extensions/ipy_editors.py index b308810..22b2959 100644 --- a/IPython/Extensions/ipy_editors.py +++ b/IPython/Extensions/ipy_editors.py @@ -11,19 +11,31 @@ ip = IPython.ipapi.get() from IPython.Itpl import itplns import os -def install_editor(run_template): +def install_editor(run_template, wait = False): + """ Gets a template in format "myeditor bah bah $file bah bah $line + + Installs the editor that is called by IPython, instead of the default + notepad or vi. + """ + def call_editor(self, file, line): if line is None: line = 0 cmd = itplns(run_template, locals()) print ">",cmd os.system(cmd) + if wait: + raw_input("Press Enter when done editing:") ip.set_hook('editor',call_editor) def komodo(exe = 'komodo'): - """ Warning - komodo does not block """ - install_editor(exe + ' -l $line "$file"') + """ Activestate Komodo [Edit] + + Warning - komodo does not block, so can't be used for plain %edit + + """ + install_editor(exe + ' -l $line "$file"', wait = True) def scite(exe = "scite"): """ Exe is the executable name of your scite.