Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pexpect/__pycache__/utils.cpython-39.pyc
Ðазад
a e�h� � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZze W n eyP ejZY n0 ej d dkrhe fZnee fZdd� Z d dd�Zdd� Zdd d �Zddd�ZdS )� N� c C sh t j�| �}t j�|�sdS t �|�j}tj�d�rZt � � dkrZt |tjtjB tj B @ �S t �|t j�S )z�Checks that path is an executable regular file, or a symlink towards one. This is roughly ``os.path isfile(path) and os.access(path, os.X_OK)``. F�sunosr )�os�path�realpath�isfile�stat�st_mode�sys�platform� startswith�getuid�bool�S_IXUSR�S_IXGRP�S_IXOTH�access�X_OK)r Zfpath�mode� r �}/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pexpect/utils.py�is_executable_file s ���r c C sv t j�| �dkrt| �r| S |du r*t j}|�d�}|s>t j}|�t j�}|D ]"}t j� || �}t|�rN| S qNdS )z�This takes a given filename; tries to find it in the environment path; then checks if it is executable. This returns the full path to the filename if found and executable. Otherwise this returns None.� N�PATH) r r �dirnamer �environ�get�defpath�split�pathsep�join)�filename�env�pZpathlistr �ffr r r �which0 s r% c C s g }d}d}d}d}d}d}|}| D ]�} ||ks8||kr�| dkrF|}q�| dkrT|}q�| d krb|}q�| � � r�||krtq�|�|� d}|}q�|| }|}q$||kr�|| }|}q$||kr�| dkr�|}q�|| }q$||kr$| d kr�|}q$|| }q$|dkr�|�|� |S ) a This splits a command line into a list of arguments. It splits arguments on spaces, but handles embedded quotes, doublequotes, and escaped characters. It's impossible to do this with a regular expression, so I wrote a little state machine to parse the command line. r r � � r � �\�'�")�isspace�append) Zcommand_line�arg_list�argZstate_basicZ state_escZstate_singlequoteZstate_doublequoteZstate_whitespace�state�cr r r �split_command_lineE sL r2 c C s� |durt � � | }zt�| |||�W S ty� t�� d }|jd tjkr||dur~|t � � }|dk r~g g g f Y S n� Y q0 qdS )z�This is a wrapper around select.select() that ignores signals. If select.select raises a select.error exception and errno is an EINTR error then it is ignored. Mainly this is used to ignore sigwinch (terminal resize). Nr&