SL48H: d dl mZ d dlZd dlmZ d dlmZ d dlmZ d dlmZ d dl m Z d dl mZ d d l mZ d d l m Z ddlmZ dd lmZ dddZddZddZd dZdS )! )annotationsN)exists)join)splitext) check_call)Dict)List)Mapping)Optional is_posix)CommandErrorfilenamestrenvironOptional[Dict[str, str]]returnNonec |t j n|} t | }t || g dS # t $ r}t d|d |d}~ww xY w)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 ())osr _find_editorr Exceptionr )r r enveditorexcs e/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/alembic/util/editor.pyopen_in_editorr s{ "**WCLc""FH%&&&&& L L LlCCCABBKLs 4 AAAMapping[str, str]c " t }t d D ]H\ }}|| v r?| | }t | r|c S t j |vr| || I|D ]}t || }||c S t d )N)EDITORVISUALzSNo suitable editor found. Please set the "EDITOR" or "VISUAL" environment variables)_default_editors enumerater r sepinsert_find_executableOSError)r candidatesivaruser_choice candidatepaths r r r ) s !##J011 2 23'>>!#,Kk"" #""""v[((!!![111 733KKK 5 r. Optional[str]c t st | d dk r| dz } | dd t j D ]%}t || }t | r|c S &d