Sh3ll
OdayForums


Server : LiteSpeed
System : Linux premium84.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
User : claqxcrl ( 523)
PHP Version : 8.1.32
Disable Function : NONE
Directory :  /opt/hc_python/lib64/python3.12/site-packages/alembic/util/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //opt/hc_python/lib64/python3.12/site-packages/alembic/util/__pycache__/editor.cpython-312.pyc
�

���g�	����ddlmZddlZddlmZddlmZddlmZddlmZddl	m
Z
ddl	mZdd	l	mZdd
l	m
Z
ddlmZdd
lmZ	d					dd�Zdd�Z						dd�Zdd�Zy)�)�annotationsN)�exists)�join)�splitext)�
check_call)�Dict)�List)�Mapping)�Optional���is_posix)�CommandErrorc��|�tjn|}	t|�}t||g�y#t$r}td|�d��|�d}~wwxYw)a�
    Opens the given file in a text editor. If the environment variable
    ``EDITOR`` is set, this is taken as preference.

    Otherwise, a list of commonly installed editors is tried.

    If no editor matches, an :py:exc:`OSError` is raised.

    :param filename: The filename to open. Will be passed  verbatim to the
        editor command.
    :param environ: An optional drop-in replacement for ``os.environ``. Used
        mainly for testing.
    NzError executing editor (�))�os�environ�_find_editorr�	Exceptionr)�filenamer�env�editor�excs     �B/opt/hc_python/lib/python3.12/site-packages/alembic/util/editor.py�open_in_editorrsR��  ��"�*�*�W�C�L��c�"���F�H�%�&���L��C�A�B��K��L�s�/�	A
�A�A
c��t�}td�D]C\}}||vs�||}t|�r|cStj|vs�2|j||��E|D]}t
||�}|��|cStd��)N)�EDITOR�VISUALzSNo suitable editor found. Please set the "EDITOR" or "VISUAL" environment variables)�_default_editors�	enumeraterr�sep�insert�_find_executable�OSError)r�
candidates�i�var�user_choice�	candidate�paths       rrr)s���!�#�J��0�1���3��'�>�!�#�,�K��k�"�"�"��v�v�[�(��!�!�!�[�1�
2� �	��	�7�3�����K� ��	5���c���tst|�ddk7r|dz
}|jdd�jtj
�D]}t
||�}t|�s�|cSy)Nrz.exe�PATH�)rr�get�splitr�pathseprr)r)rr*�values    rr#r#=sc��
���+�A�.�&�8��V��	����F�B�'�-�-�b�j�j�9���T�9�%���%�=��L�:�r+c��trgd�Sgd�S)N)zsensible-editorr�nano�vim�code)zcode.exez
notepad++.exeznotepad.exer
�r+rrrKs���C�C�;�;r+)N)r�strrzOptional[Dict[str, str]]�return�None)r�Mapping[str, str]r9r8)r)r8rr;r9z
Optional[str])r9z	List[str])�
__future__rr�os.pathrrr�
subprocessr�typingrr	r
r�compatrrrrrr#rr7r+r�<module>rAsv��"�	����!�������8<�L��L�4�L�	�L�0�(���.����<r+

ZeroDay Forums Mini