HEX
Server: LiteSpeed
System: Linux standart9.isimtescil.net 3.10.0-962.3.2.lve1.5.26.7.el7.x86_64 #1 SMP Wed Oct 2 07:53:12 EDT 2019 x86_64
User: karalev (5310)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //opt/alt/python37/lib64/python3.7/__pycache__/posixpath.cpython-37.pyc
B

� f�=�&@s^dZdZdZdZdZdZdZdZdZddl	Z	ddl
Z
ddlZddlZdd	lTd
ddd
ddddddddddddddddddd d!d"d#d$d%d&d'd(d)d*d+d,d-d.d/g&Z
d0d1�Zd2d
�Zd3d�Zd4d�Zd5d�Zd6d�Zejje_d7d
�Zd8d�Zd9d�Zd:d�Zd;d�Zd<d�Zd=d�Zdadad>d�Zd?d�Zd@d �Z dAd,�Z!dBdC�Z"e
j#dDkZ$dGdEd.�Z%dFd/�Z&dS)Ha�Common operations on Posix pathnames.

Instead of importing this module directly, import os and refer to
this module as os.path.  The "os.path" name is an alias for this
module on Posix systems; on other systems (e.g. Mac, Windows),
os.path provides the same operations in a manner specific to that
platform, and is an alias to another module (e.g. macpath, ntpath).

Some of this can actually be useful on non-Posix systems too, e.g.
for manipulation of the pathname component of URLs.
�.z..�/�:z
/bin:/usr/binNz	/dev/null�)�*�normcase�isabs�join�
splitdrive�split�splitext�basename�dirname�commonprefixZgetsizeZgetmtimeZgetatimeZgetctime�islink�exists�lexists�isdir�isfile�ismount�
expanduser�
expandvars�normpath�abspathZsamefileZsameopenfile�samestat�curdir�pardir�sep�pathsep�defpath�altsep�extsep�devnull�realpath�supports_unicode_filenames�relpath�
commonpathcCst|t�rdSdSdS)N�/r)�
isinstance�bytes)�path�r*�./opt/alt/python37/lib64/python3.7/posixpath.py�_get_sep)s
r,cCs.t�|�}t|ttf�s*td�|jj���|S)z6Normalize case of pathname.  Has no effect under Posixz2normcase() argument must be str or bytes, not '{}')	�os�fspathr'r(�str�	TypeError�format�	__class__�__name__)�sr*r*r+r4s

cCst�|�}t|�}|�|�S)zTest whether a path is absolute)r-r.r,�
startswith)r4rr*r*r+r@s
c
Gs�t�|�}t|�}|}yb|s,|dd�|xHttj|�D]8}|�|�rN|}q:|r\|�|�rf||7}q:|||7}q:WWn.tttfk
r�t	j
d|f|���YnX|S)z�Join two or more pathname components, inserting '/' as needed.
    If any component is an absolute path, all previous path components
    will be discarded.  An empty last part will result in a path that
    ends with a separator.Nrr)r-r.r,�mapr5�endswithr0�AttributeError�BytesWarning�genericpath�_check_arg_types)�a�prr)�br*r*r+rKs 


cCs`t�|�}t|�}|�|�d}|d|�||d�}}|rX||t|�krX|�|�}||fS)z�Split a pathname.  Returns tuple "(head, tail)" where "tail" is
    everything after the final slash.  Either part may be empty.�N)r-r.r,�rfind�len�rstrip)r=r�i�head�tailr*r*r+r
hs

cCs6t�|�}t|t�rd}d}nd}d}t�||d|�S)Nr&�.rr)r-r.r'r(r:�	_splitext)r=rr r*r*r+rys

cCst�|�}|dd�|fS)zJSplit a pathname into drive and path. On Posix, drive is always
    empty.Nr)r-r.)r=r*r*r+r	�s
cCs,t�|�}t|�}|�|�d}||d�S)z)Returns the final component of a pathnamer?N)r-r.r,r@)r=rrCr*r*r+r�s
cCsNt�|�}t|�}|�|�d}|d|�}|rJ||t|�krJ|�|�}|S)z-Returns the directory component of a pathnamer?N)r-r.r,r@rArB)r=rrCrDr*r*r+r
�s

c	Cs4yt�|�}Wnttfk
r&dSXt�|j�S)z&Test whether a path is a symbolic linkF)r-�lstat�OSErrorr8�stat�S_ISLNK�st_mode)r)�str*r*r+r�s
cCs(yt�|�Wntk
r"dSXdS)zCTest whether a path exists.  Returns True for broken symbolic linksFT)r-rHrI)r)r*r*r+r�s
cCs�yt�|�}Wntk
r"dSXt�|j�r4dSt|t�rJt|d�}n
t|d�}t	|�}yt�|�}Wntk
r~dSX|j
}|j
}||kr�dS|j}|j}||kr�dSdS)z$Test whether a path is a mount pointFs..z..T)r-rHrIrJrKrLr'r(rr"�st_dev�st_ino)r)�s1�parent�s2Zdev1Zdev2Zino1Zino2r*r*r+r�s.

c	Cs4t�|�}t|t�rd}nd}|�|�s,|St|�}|�|d�}|dkrPt|�}|dkr�dtjkr�ddl	}y|�
t���j}Wq�t
k
r�|SXq�tjd}nRddl	}|d|�}t|t�r�t|d�}y|�|�}Wnt
k
r�|SX|j}t|t��rt�|�}d}nd	}|�|�}|||d��p2|S)
zOExpand ~ and ~user constructions.  If user or $HOME is unknown,
    do nothing.�~�~r?rZHOMEN�ASCIIr&r)r-r.r'r(r5r,�findrA�environ�pwdZgetpwuid�getuidZpw_dir�KeyErrorr/Zgetpwnam�fsencoderB)	r)ZtilderrCrXZuserhome�nameZpwentZrootr*r*r+r�sB







cCs\t�|�}t|t�rVd|kr |Sts:ddl}|�d|j�atj}d}d}t	tdd�}n:d|krb|St
s|ddl}|�d	|j�a
t
j}d
}d}tj}d}x�|||�}|s�P|�d�\}}|�
d�}	|	�|�r�|	�|�r�|	dd
�}	y.|dk�rt�tjt�|	��}
n||	}
Wntk
�r&|}Yq�X||d�}|d|�|
}t|�}||7}q�W|S)zZExpand shell variables of form $var and ${var}.  Unknown variables
    are left unchanged.�$rNs\$(\w+|\{[^}]*\})�{�}�environb�$z\$(\w+|\{[^}]*\})�{�}r?���)r-r.r'r(�	_varprogb�re�compilerU�search�getattr�_varprogrWZspanZgroupr5r7r[�fsdecoderZrA)r)rfrh�start�endrWrC�m�jr\�valuerEr*r*r+rsP





c	Cs�t�|�}t|t�r&d}d}d}d}nd}d}d}d}||krB|S|�|�}|rp|�|d	�rp|�|d
�spd	}|�|�}g}xR|D]J}|||fkr�q�||ks�|s�|r�|r�|d|kr�|�|�q�|r�|��q�W|}|�|�}|r�|||}|p�|S)z0Normalize path, eliminating double slashes, etc.r&�rFs..r�rz..��rd)	r-r.r'r(r5r
�append�popr)	r)rZempty�dotZdotdotZinitial_slashesZcompsZ	new_compsZcompr*r*r+rRs>





cCs@t�|�}t|�s8t|t�r&t��}nt��}t||�}t|�S)zReturn an absolute path.)	r-r.rr'r(�getcwdb�getcwdrr)r)Zcwdr*r*r+rxs



cCs*t�|�}t|dd�|i�\}}t|�S)zlReturn the canonical path of the specified filename, eliminating any
symbolic links encountered in the path.Nr)r-r.�
_joinrealpathr)�filenamer)�okr*r*r+r"�s
c
Cst|t�rd}d}d}nd}d}d}t|�r<|dd�}|}x�|�r|�|�\}}}|r>||krbq>||kr�|r�t|�\}}||kr�t|||�}q>|}q>t||�}t|�s�|}q>||kr�||}|dk	r�q>t||�dfSd||<t|t�	|�|�\}}	|	�st||�dfS|||<q>W|d	fS)
Nr&rFs..rrz..r?FT)
r'r(r�	partitionr
rrrzr-�readlink)
r)�rest�seenrrrr\�_Znewpathr|r*r*r+rz�sH

rz�darwinc	Cs�|std��t�|�}t|t�r.d}d}d}nd}d}d}|dkrH|}n
t�|�}ynd	d
�t|��|�D�}dd
�t|��|�D�}tt||g��}|gt|�|||d�}|s�|St	|�St
ttt
fk
r�t�d||��YnXdS)
z#Return a relative version of a pathzno path specifiedrFr&s..rrz..NcSsg|]}|r|�qSr*r*)�.0�xr*r*r+�
<listcomp>�szrelpath.<locals>.<listcomp>cSsg|]}|r|�qSr*r*)r�r�r*r*r+r��sr$)�
ValueErrorr-r.r'r(rr
rArrr0r8r9�DeprecationWarningr:r;)	r)rlrrrZ
start_list�	path_listrCZrel_listr*r*r+r$�s0


c		s2|std��tttj|��}t|dt�r4d�d�nd�d�yƇfdd�|D�}yt�fd	d
�|D��\}Wntk
r�td�d�YnX�fd
d�|D�}t|�}t	|�}|}x.t
|�D]"\}}|||kr�|d|�}Pq�W|r�n
�dd�}|��|�Stt
fk
�r,tjd|���YnXdS)zDGiven a sequence of path names, returns the longest common sub-path.z%commonpath() arg is an empty sequencerr&rFrrcsg|]}|����qSr*)r
)r�r))rr*r+r��szcommonpath.<locals>.<listcomp>c3s|]}|dd��kVqdS)Nr?r*)r�r=)rr*r+�	<genexpr>szcommonpath.<locals>.<genexpr>z%Can't mix absolute and relative pathsNcsg|]}�fdd�|D��qS)csg|]}|r|�kr|�qSr*r*)r��c)rr*r+r�sz)commonpath.<locals>.<listcomp>.<listcomp>r*)r�r4)rr*r+r�sr%)r%)r��tupler6r-r.r'r(�set�min�max�	enumeraterr0r8r:r;)	�pathsZsplit_pathsrrPrRZcommonrCr��prefixr*)rrr+r%�s6)N)'�__doc__rrr rrrrr!r-�sysrJr:�__all__r,rrrr
rrGr	rr
rrrrrjrerrrr"rz�platformr#r$r%r*r*r*r+�<module>sZ

	
	

*25&	3

)