HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/pexpect/__pycache__/utils.cpython-38.pyc
U

�C
[��@s�ddlZddlZddlZddlZddlZddlZzeWnek
rRejZYnXej	ddkrje
fZnee
fZdd�Z
d
dd�Zdd�Zdd	d
�Zddd�ZdS)�N�cCshtj�|�}tj�|�sdSt�|�j}tj�d�rZt�	�dkrZt
|tjtjBtj
B@�St�|tj�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)``.
    FZsunosr)�os�path�realpath�isfile�stat�st_mode�sys�platform�
startswith�getuid�bool�S_IXUSR�S_IXGRP�S_IXOTH�access�X_OK)rZfpath�mode�r�//usr/lib/python3/dist-packages/pexpect/utils.py�is_executable_files
���rcCsvtj�|�dkrt|�r|S|dkr*tj}|�d�}|s>tj}|�tj�}|D]"}tj�	||�}t|�rN|SqNdS)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)
rr�dirnamer�environ�get�defpath�split�pathsep�join)�filename�env�pZpathlistrZffrrr�which0s

r#c
Csg}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)
aThis 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. rr��r��\�'�")�isspace�append)
Zcommand_line�arg_list�argZstate_basicZ	state_escZstate_singlequoteZstate_doublequoteZstate_whitespace�state�crrr�split_command_lineEsL



r0cCs�|dk	rt��|}zt�||||�WStk
r�t��d}|jdtjkr~|dk	r�|t��}|dkr�gggfYSn�YqXqdS)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$r)�time�select�InterruptedErrorr	�exc_info�args�errno�EINTR)ZiwtdZowtdZewtd�timeout�end_time�errrrr�select_ignore_interrupts�s	r;cCs�|dk	rt��|}t��}|D]$}|�|tjtjBtjBtjB�q z.|dkrTdn|d}|�|�}dd�|D�WStk
r�t	�
�d}|jdtj
kr�|dk	r�|t��}|dkr�gYSn�YqFXqFdS)zOSimple wrapper around poll to register file descriptors and
    ignore signals.Ni�cSsg|]\}}|�qSrr)�.0Zafd�_rrr�
<listcomp>�sz*poll_ignore_interrupts.<locals>.<listcomp>r$r)r1r2Zpoll�registerZPOLLINZPOLLPRIZPOLLHUPZPOLLERRr3r	r4r5r6r7)Zfdsr8r9Zpoller�fdZ
timeout_msZresultsr:rrr�poll_ignore_interrupts�s""

rA)N)N)N)rr	rr2r1r6r3�	NameError�error�version_info�strZstring_typesZunicoderr#r0r;rArrrr�<module>s"
=