Repository URL to install this package:
|
Version:
0.1.31 ▾
|
odigos-demo-inventory
/
opt
/
odigos-demo-inventory
/
site-packages
/
pexpect
/
__pycache__
/
utils.cpython-311.pyc
|
|---|
§
hµµh ã ó¸ d dl Z d dlZd dlZd dlZd dlZd dlZ e n# e$ r
ej ZY nw xY wej d dk re
fZnee
fZd Z
ddZd ZddZddZdS ) é Né c óÊ t j | ¦ « }t j |¦ « sdS t j |¦ « j }t j d¦ « rMt j ¦ « dk r6t |t j t j z t j
z z ¦ « S t j |t j ¦ « S )zChecks 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 ÚfpathÚmodes ú8/usr/local/lib/python3.11/site-packages/pexpect/utils.pyÚis_executable_filer s¶ õ
G×ÒTÑ"Ô"Eå
7>>%Ñ Ô ð àuå
75>>Ô!Då×Ò Ñ(Ô(ð +Ý qÒ Ð õ DDLÝ Lñ)å Lñ)ñ *ñ +ô +ð +õ 9UBGÑ$Ô$Ð$ó c ó~ t j | ¦ « dk rt | ¦ « r| S |t j }| d¦ « }|st j }| t j ¦ « }|D ]5}t j || ¦ « }t |¦ « r|c S 6dS )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ÚpÚpathlistr Úffs r Úwhichr* 0 s´ õ
wxÑ Ô BÒ&Ð&Õ+=¸hÑ+GÔ+GÐ&ØØ
{ÝjØAØð ÝJØwwrzÑ"Ô"HØð ð Ý
W\\$ Ñ
)Ô
)ÝbÑ!Ô!ð ØIIIð à4r c ó g }d}d}d}d}d}d}|}| D ]} ||k s||k rX| dk r|}| dk r|} | d k r|})| ¦ « r!||k rD| |¦ « d}|}^|| z }|}f||k r|| z }|}t||k r| dk r|}|| z }||k r| d k r|}|| z }|dk r| |¦ « |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)
Úcommand_lineÚarg_listÚargÚstate_basicÚ state_escÚstate_singlequoteÚstate_doublequoteÚstate_whitespaceÚstateÚcs
r Úsplit_command_liner>