wL idZddlZddlZddlZddlZddlmZddlmZddl m Z ddZ ddZ ddZ dd Zdd Zdd Zdd Zdd ZddZddZddZy)z 'editor' hooks for common editors that work well with ipython They should honor the line number argument, at least. Contributions are *very* welcome. N) get_ipython)TryNext) py3compatchdfd }tjd|t_y)ayInstalls the editor that is called by IPython for the %edit magic. This overrides the default editor, which is generally set by your EDITOR environment variable or is notepad (windows) or vi (linux). By supplying a template string `run_template`, you can control how the editor is invoked by IPython -- (e.g. the format in which it accepts command line options) Parameters ---------- template : basestring run_template acts as a template for how your editor is invoked by the shell. It should contain '{filename}', which will be replaced on invocation with the file name, and '{line}', $line by line number (or 0) to invoke the file with. wait : bool If `wait` is true, wait until the user presses enter before returning, to facilitate non-blocking editors that exit immediately after the call. cr|d}jtj||}td|tj j drtj|}tj|d}|jdk7r trtjdyy)Nr)filenameline>winT)shellzPress Enter when done editing:)formatshlexquoteprintsysplatform startswithsplit subprocessPopenwaitrrinput)selfrr cmdproctemplaters ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/IPython/lib/editorhooks.py call_editorz#install_editor..call_editor.s <Doou{{8'<4oH c3 << " "5 )++c"C40 99;! )O  OO< = editorN)r)rset_hookr )rrrs`` rinstall_editorr"s&8 >M8[1#KMrc$t|dzdy)z Activestate Komodo [Edit] z -l {line} {filename}T)rNr"exes rkomodor'Bs311=rc t|dzy)z SciTE or Sc1 z {filename} -goto:{line}Nr$r%s rsciter)Gs3445rc t|dzy)z/ Notepad++ http://notepad-plus.sourceforge.net z -n{line} {filename}Nr$r%s rnotepadplusplusr+Ls3001rc t|dzy)z& JED, the lightweight emacsish editor  +{line} {filename}Nr$r%s rjedr.Qs3//0rc|Mddl}tjj|j}tjj |d}t |dzy)z Idle, the editor bundled with python Parameters ---------- exe : str, None If none, should be pretty smart about finding the executable. Nrzidle.pyz {filename})idlelibospathdirname __filename__joinr")r&r0ps ridler7VsG { GGOOG00 1ggll1i(3'(rc t|dzy)z TextMate, the missing editorz -w -l {line} {filename}Nr$r%s rmater9gs3445rc t|dzy)Nr-r$r%s remacsr;rs3//0rc t|dzy)Nz -nw +{line} {filename}r$r%s r gnuclientr=vs3334rc t|dzy)Nz /L:{line} {filename}r$r%s rcrimson_editorr?zs3112rc t|dzy)Nz -u -l {line} {filename}r$r%s rkaterA~s3445r)F)r')r))z notepad++)r.)r7)r9)r;)r=)zcedt.exe)rA)__doc__r1rrrIPythonrIPython.core.errorr IPython.utilsrr"r'r)r+r.r7r9r;r=r?rArrrGsY  &#+$`> 6 2 1 )"61536r