§
    �ŸjŽ  ã                   ó¦   — d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl	m
Z
 dd„Zdd	„Zdd„Zdd„Zd d„Zd!d„Zd"d„Zd#d„Zd$d„Zd%d„Zd&d„ZdS )'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)Ú	py3compatFc                 ó‚   ‡ ‡— dˆ ˆfd„	}t          ¦   «                              d|¦  «         ‰ t          ¦   «         _        dS )ay  Installs 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.
    r   c                 ó�  •— |€d}‰                      t          j        |¦  «        |¬¦  «        }t          d|¦  «         t          j                             d¦  «        rt          j        |¦  «        }t          j	        |d¬¦  «        }| 
                    ¦   «         dk    rt          ¦   «         ‚‰rt          j        d¦  «         d S d S )Nr   )ÚfilenameÚlineú>ÚwinT)ÚshellzPress Enter when done editing:)ÚformatÚshlexÚquoteÚprintÚsysÚplatformÚ
startswithÚsplitÚ
subprocessÚPopenÚwaitr   r   Úinput)Úselfr   r	   ÚcmdÚprocÚtemplater   s        €€úd/var/www/finuniver-perm.ru/html/student/venv/lib/python3.11/site-packages/IPython/lib/editorhooks.pyÚcall_editorz#install_editor.<locals>.call_editor.   sº   ø€ Øˆ<ØˆDØ�oŠo¥u¤{°8Ñ'<Ô'<À4ˆoÑHÔHˆÝˆc�3‰ŒˆåŒ<×"Ò" 5Ñ)Ô)ð 	#Ý”+˜cÑ"Ô"ˆCÝÔ ¨4Ð0Ñ0Ô0ˆØ�9Š9‰;Œ;˜!ÒÐÝ‘)”)ˆOØð 	>ÝŒOÐ<Ñ=Ô=Ð=Ð=Ð=ð	>ð 	>ó    ÚeditorN)r   )r   Úset_hookr    )r   r   r   s   `` r   Úinstall_editorr"      sU   øø€ ð8>ð >ð >ð >ð >ð >ð >õ �M„M×Ò˜8 [Ñ1Ô1Ð1Ø#…K�M„MÔÐÐr   Úkomodoc                 ó.   — t          | dz   d¬¦  «         dS )z Activestate Komodo [Edit] z -l {line} {filename}T)r   N©r"   ©Úexes    r   r#   r#   B   s!   € å�3Ð1Ñ1¸Ð=Ñ=Ô=Ð=Ð=Ð=r   Úscitec                 ó*   — t          | dz   ¦  «         dS )z SciTE or Sc1 z {filename} -goto:{line}Nr%   r&   s    r   r(   r(   G   s   € å�3Ð4Ñ4Ñ5Ô5Ð5Ð5Ð5r   ú	notepad++c                 ó*   — t          | dz   ¦  «         dS )z/ Notepad++ http://notepad-plus.sourceforge.net z -n{line} {filename}Nr%   r&   s    r   Únotepadplusplusr,   L   s   € å�3Ð0Ñ0Ñ1Ô1Ð1Ð1Ð1r   Újedc                 ó*   — t          | dz   ¦  «         dS )z& JED, the lightweight emacsish editor ú +{line} {filename}Nr%   r&   s    r   r-   r-   Q   s   € å�3Ð/Ñ/Ñ0Ô0Ð0Ð0Ð0r   Úidlec                 ó¾   — | €Hddl }t          j                             |j        ¦  «        }t          j                             |d¦  «        } t          | dz   ¦  «         dS )z£ Idle, the editor bundled with python

    Parameters
    ----------
    exe : str, None
        If none, should be pretty smart about finding the executable.
    Nr   zidle.pyz {filename})ÚidlelibÚosÚpathÚdirnameÚ__filename__Újoinr"   )r'   r2   Úps      r   r0   r0   V   sX   € ð €{ØˆˆˆÝŒG�OŠO˜GÔ0Ñ1Ô1ˆõ Œg�lŠl˜1˜iÑ(Ô(ˆÝ�3˜Ñ'Ñ(Ô(Ð(Ð(Ð(r   Úmatec                 ó*   — t          | dz   ¦  «         dS )z TextMate, the missing editorz -w -l {line} {filename}Nr%   r&   s    r   r9   r9   g   s   € õ �3Ð4Ñ4Ñ5Ô5Ð5Ð5Ð5r   Úemacsc                 ó*   — t          | dz   ¦  «         d S )Nr/   r%   r&   s    r   r;   r;   r   s   € Ý�3Ð/Ñ/Ñ0Ô0Ð0Ð0Ð0r   Ú	gnuclientc                 ó*   — t          | dz   ¦  «         d S )Nz -nw +{line} {filename}r%   r&   s    r   r=   r=   v   s   € Ý�3Ð3Ñ3Ñ4Ô4Ð4Ð4Ð4r   úcedt.exec                 ó*   — t          | dz   ¦  «         d S )Nz /L:{line} {filename}r%   r&   s    r   Úcrimson_editorrA   z   s   € Ý�3Ð1Ñ1Ñ2Ô2Ð2Ð2Ð2r   Úkatec                 ó*   — t          | dz   ¦  «         d S )Nz -u -l {line} {filename}r%   r&   s    r   rB   rB   ~   s   € Ý�3Ð4Ñ4Ñ5Ô5Ð5Ð5Ð5r   )F)r#   )r(   )r*   )r-   )r0   )r9   )r;   )r=   )r?   )rB   )Ú__doc__r3   r   r   r   ÚIPythonr   ÚIPython.core.errorr   ÚIPython.utilsr   r"   r#   r(   r,   r-   r0   r9   r;   r=   rA   rB   © r   r   ú<module>rI      sU  ððð ð 
€	€	€	Ø €€€Ø Ð Ð Ð Ø 
€
€
€
à Ð Ð Ð Ð Ð Ø &Ð &Ð &Ð &Ð &Ð &Ø #Ð #Ð #Ð #Ð #Ð #ð+$ð +$ð +$ð +$ð`>ð >ð >ð >ð
6ð 6ð 6ð 6ð
2ð 2ð 2ð 2ð
1ð 1ð 1ð 1ð
)ð )ð )ð )ð"6ð 6ð 6ð 6ð1ð 1ð 1ð 1ð5ð 5ð 5ð 5ð3ð 3ð 3ð 3ð6ð 6ð 6ð 6ð 6ð 6r   