AlkantarClanX12

Your IP : 3.138.69.39


Current Path : /opt/alt/python37/lib64/python3.7/__pycache__/
Upload File :
Current File : //opt/alt/python37/lib64/python3.7/__pycache__/pathlib.cpython-37.opt-2.pyc

B

YI~d���@sjddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe� �dd	�d
kr�ddlm!Z!q�dZdZ!ndZd
dddddgZ"ee
eefZ#dZ$dd�Z%dd�Z&Gdd�de'�Z(Gdd�de(�Z)Gdd�de(�Z*e)�Z+e*�Z,Gdd�d�Z-Gd d!�d!e-�Z.e.�Z/d"d#�Z0e1ed$��r�e�2�e0�Z0Gd%d&�d&�Z3Gd'd(�d(�Z4Gd)d*�d*e3�Z5Gd+d,�d,e3�Z6Gd-d.�d.e3�Z7Gd/d0�d0e	�Z8Gd1d
�d
e'�Z9ej:�;e9�Gd2d�de9�Z<Gd3d�de9�Z=Gd4d�de9�Z>Gd5d�de>e<�Z?Gd6d�de>e=�Z@dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF�ELOOP)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt�)�r)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPath)�i�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r �,/opt/alt/python37/lib64/python3.7/pathlib.py�
_ignore_error-sr"cCsd|kpd|kpd|kS)N�*�?�[r )�patr r r!�_is_wildcard_pattern2sr'c@s$eZdZdd�Zdd�Zdd�ZdS)�_FlavourcCs|jj|_dS)N)�sep�join)�selfr r r!�__init__<sz_Flavour.__init__cCsg}|j}|j}d}}t|�}x�|D]�}|s0q&|r@|�||�}|�|�\}}}	||	kr�xPt|	�|��D] }
|
rh|
dkrh|�t�|
��qhWn|	r�|	dkr�|�t�|	��|s�|r&|s�x6|D].}|s�q�|r�|�||�}|�|�d}|r�Pq�WPq&W|s�|�r|�||�|�	�|||fS)N��.r)
r)�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r+�partsZparsedr)r/�drv�root�it�partZrel�xr r r!�parse_parts?s@


z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS)N�)�casefold)r+r9r:r8Zdrv2Zroot2Zparts2r r r!�join_parsed_partsesz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__r,r>rAr r r r!r(8s&r(c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zdd�Zd&dd�Ze
fdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%S)'�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr )�.0�ir r r!�	<setcomp>�sz_WindowsFlavour.<setcomp>r?�
cCsh|]}d|�qS)zLPT%dr )rHrIr r r!rJ�scCs\|dd�}|dd�}||krP||krP|�|�\}}|dd�}|dd�}nd}|dd�}||kr�||kr�||kr�|�|d�}|dkr�|�||d�}||dkr�|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r6||jk�r6|dd�}	|dd�}|}||k�rN|}
|�|�}||	|
|fS)Nrr?rr-�����:)�_split_extended_path�find�len�
drive_letters�lstrip)r+r<r)�first�second�prefixZthird�indexZindex2r9r:r r r!r2�s6"

z_WindowsFlavour.splitrootcCs|��S)N)�lower)r+�sr r r!r@�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr )rX)rH�pr r r!�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r )r+r8r r r!�casefold_parts�sz_WindowsFlavour.casefold_partscCst�t�|�tj�jS)N)�re�compile�fnmatch�	translate�
IGNORECASE�	fullmatch)r+�patternr r r!�compile_pattern�sz_WindowsFlavour.compile_patternFcCs�t|�}|st��Sd}tdk	r�|r2|�t|��Sg}xly|�t|��}Wn>tk
r�|}tj�|�\}}|�|�||kr�|SYq8Xtjj	|ft
|���Sq8WdS)N)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr3r4r*r0)r+rj�strictrYZ
previous_sZ
tail_parts�tailr r r!�resolve�s&

z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr-�zUNC\rLrF)�
startswith)r+rYZ
ext_prefixrVr r r!rO�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dS)Nr?)rO)r+rYr r r!rh�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rMr.)ro�	partition�upper�reserved_names)r+r8r r r!�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|��dd��d�}d|t|�d��fSdt|���d��SdS)Nrr?rNrGz
file:///%s/%szutf-8zfile:)�driverQ�as_posixrS�urlquote_from_bytes�encode)r+rjrt�restr r r!�make_uri�sz_WindowsFlavour.make_uricCs�dtjkrtjd}n`dtjkr,tjd}nJdtjkrnytjd}Wntk
r\d}YnX|tjd}ntd��|r�tjd|kr�|�|f�\}}}|dtjdkr�td	|��||d<|s�|r�|||�|d
d��}n
|�|�}|S)N�HOMEZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr-zCan't determine home directoryZUSERNAMErMz%Can't determine home directory for %rr?)rf�environ�KeyError�RuntimeErrorr>r*)r+�username�userhomer9r:r8r r r!�
gethomedir�s,




z_WindowsFlavour.gethomedirN)F)rBrCrDr)r/�has_drv�ntpath�pathmodrf�name�is_supported�setrRZext_namespace_prefix�rangerrr2r@r\rdrmrOrhrsryr�r r r r!rEws&
	'

rEc@sleZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
dd�Zdd
d�Zdd�Zdd�Zdd�ZdS)�
_PosixFlavourrGr-FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr-)rSrQ)r+r<r)Z
stripped_partr r r!r2&s
z_PosixFlavour.splitrootcCs|S)Nr )r+rYr r r!r@5sz_PosixFlavour.casefoldcCs|S)Nr )r+r8r r r!r\8sz_PosixFlavour.casefold_partscCst�t�|��jS)N)r]r^r_r`rb)r+rcr r r!rd;sz_PosixFlavour.compile_patterncsJ|j�|j�i������fdd��|��r0dnt��}�|t|��pH�S)Ncs�|���rd}x�|���D]�}|r|dkr,q|dkrF|���\}}}q|�|}|�krx�|}|dk	rlqtd|��y��|�}Wn6tk
r�}z|jtkr��r��|}Wdd}~XYqXd�|<�||�}|�|<qW|S)Nr-r.z..zSymlink loop from %r)ror3�
rpartitionr}�readlink�OSErrorrr)rjrxr��_�newpath�target�e)�_resolve�accessor�seenr)rkr r!r�Bs0

z'_PosixFlavour.resolve.<locals>._resolver-)r)�	_accessor�is_absoluterfrgre)r+rjrk�baser )r�r�r�r)rkr!rm>s&z_PosixFlavour.resolvecCsdS)NFr )r+r8r r r!rsksz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesrv)r+rjZbpathr r r!rynsz_PosixFlavour.make_uricCst|s:y
tjdStk
r6ddl}|�t���jSXn6ddl}y|�|�jStk
rntd|��YnXdS)Nrzrz%Can't determine home directory for %r)	rfr{r|�pwd�getpwuid�getuid�pw_dir�getpwnamr})r+r~r�r r r!r�ts
z_PosixFlavour.gethomedirN)F)rBrCrDr)r/r��	posixpathr�rfr�r�r2r@r\rdrmrsryr�r r r r!r�s

-r�c@seZdZdS)�	_AccessorN)rBrCrDr r r r!r��sr�c@s�eZdZejZejZejZejZejZej	Z	e
ed�r>ejZndd�ZejZej
Z
ejZejZejZer~ertejZq�dd�Znedd��ZejZdd�Zd	S)
�_NormalAccessor�lchmodcCstd��dS)Nz%lchmod() not available on this system)�NotImplementedError)r+Zpathobj�moder r r!r��sz_NormalAccessor.lchmodcCstd��dS)Nz&symlink() not available on this system)r�)�a�b�target_is_directoryr r r!�symlink�sz_NormalAccessor.symlinkcCst�||�S)N)rfr�)r�r�r�r r r!r��scCs
t�|�S)N)rfr�)r+rjr r r!r��sz_NormalAccessor.readlinkN)rBrCrDrf�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlink�rmdir�renamer1r�supports_symlinksr��staticmethod�utimer�r r r r!r��s*

r�cCsR|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}||||�S)Nrr?z**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr'�_WildcardSelector�_PreciseSelector)�
pattern_parts�flavourr&�child_parts�clsr r r!�_make_selector�s
r��	lru_cachec@seZdZdd�Zdd�ZdS)�	_SelectorcCs0||_|rt||�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r+r�r�r r r!r,�sz_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�S)N)�type�is_dir�existsr�r��iter�_select_from)r+�parent_pathZpath_clsr�r�r�r r r!�select_from�sz_Selector.select_fromN)rBrCrDr,r�r r r r!r��s	r�c@seZdZdd�ZdS)r�ccs
|VdS)Nr )r+r�r�r�r�r r r!r��sz!_TerminatingSelector._select_fromN)rBrCrDr�r r r r!r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�|||�dS)N)r�r�r,)r+r�r�r�r r r!r,�sz_PreciseSelector.__init__ccs^yD|�|j�}|jr|n||�rBx |j�||||�D]
}|Vq4WWntk
rXdSXdS)N)�_make_child_relpathr�r�r�r��PermissionError)r+r�r�r�r�rjrZr r r!r��sz_PreciseSelector._select_fromN)rBrCrDr,r�r r r r!r��sr�c@seZdZdd�Zdd�ZdS)r�cCs|�|�|_t�|||�dS)N)rd�matchr�r,)r+r&r�r�r r r!r,sz_WildcardSelector.__init__ccs�y�||��}t|�}WdQRXx�|D]�}|jrly|��s:w$Wn.tk
rj}zt|�sX�w$Wdd}~XYnX|j}	|�|	�r$|�|	�}
x |j�	|
|||�D]
}|Vq�Wq$WWnt
k
r�dSXdS)N)�listr�r�r�r"r�r�r�r�r�r�)r+r�r�r�r��
scandir_it�entries�entryr�r�rjrZr r r!r�s&



z_WildcardSelector._select_fromN)rBrCrDr,r�r r r r!r�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�|||�dS)N)r�r,)r+r&r�r�r r r!r,&sz#_RecursiveWildcardSelector.__init__ccs�|Vy�||��}t|�}WdQRXx�|D]x}d}y|��}Wn,tk
rj}zt|�sZ�Wdd}~XYnX|r*|��s*|�|j�}	x|�|	||�D]
}
|
Vq�Wq*WWntk
r�dSXdS)NF)	r�r�r�r"�
is_symlinkr�r��_iterate_directoriesr�)r+r�r�r�r�r�r�Zentry_is_dirr�rjrZr r r!r�)s"

z/_RecursiveWildcardSelector._iterate_directoriesc	cs�yjt�}zT|jj}xF|�|||�D]4}x.|||||�D]}||kr6|V|�|�q6Wq"WWd|��XWntk
r~dSXdS)N)r�r�r�r��add�clearr�)	r+r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrZr r r!r�<sz'_RecursiveWildcardSelector._select_fromN)rBrCrDr,r�r�r r r r!r�$sr�c@s0eZdZdZdd�Zdd�Zdd�Zdd	�Zd
S)�_PathParents)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dS)N)r�r�r�r�r�)r+rjr r r!r,Us
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdS)Nr?)r�r�rQr�)r+r r r!�__len__\sz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)Nrr?)rQ�
IndexErrorr��_from_parsed_partsr�r�r�)r+�idxr r r!�__getitem__bsz_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rB)r+r r r!�__repr__hsz_PathParents.__repr__N)rBrCrD�	__slots__r,r�r�r�r r r r!r�Ps
r�c@s�eZdZdZdd�Zdd�Zedd��ZedUd	d
��ZedVdd��Z	ed
d��Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zedd ��Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zeed-�d.d/�Zeed0�d1d/�Zed2d3��Zed4d5��Zed6d7��Z ed8d9��Z!ed:d;��Z"d<d=�Z#d>d?�Z$d@dA�Z%edBdC��Z&dDdE�Z'dFdG�Z(dHdI�Z)edJdK��Z*edLdM��Z+dNdO�Z,dPdQ�Z-dRdS�Z.dTS)Wr)r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)Nr)rrfr�rr�_from_parts)r��argsr r r!�__new__zszPurePath.__new__cCs|jt|j�fS)N)�	__class__�tupler�)r+r r r!�
__reduce__�szPurePath.__reduce__cCshg}xV|D]N}t|t�r$||j7}q
t�|�}t|t�rH|�t|��q
tdt|���q
W|j	�
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�rf�fspathrer4�	TypeErrorr��_flavourr>)r�r�r8r�r r r!�_parse_args�s



zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|S)N)�objectr�r�r�r�r��_init)r�r��initr+r9r:r8r r r!r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|S)N)r�r�r�r�r�r�)r�r9r:r8r�r+r r r!r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdS)Nr?)r�r*)r�r9r:r8r r r!�_format_parsed_parts�szPurePath._format_parsed_partscCsdS)Nr )r+r r r!r��szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�S)N)r�r�rAr�r�r�r�)r+r�r9r:r8r r r!�_make_child�szPurePath._make_childcCs<y|jStk
r6|�|j|j|j�p,d|_|jSXdS)Nr.)r��AttributeErrorr�r�r�r�)r+r r r!�__str__�szPurePath.__str__cCst|�S)N)re)r+r r r!�
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)NrG)r�rer1r))r+�fr r r!ru�szPurePath.as_posixcCs
t�|�S)N)rf�fsencode)r+r r r!�	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rBru)r+r r r!r��szPurePath.__repr__cCs|��std��|j�|�S)Nz.relative path can't be expressed as a file URI)r�r�r�ry)r+r r r!�as_uri�szPurePath.as_uricCs2y|jStk
r,|j�|j�|_|jSXdS)N)r�r�r�r\r�)r+r r r!�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkS)N)r�r�NotImplementedr�r�)r+�otherr r r!�__eq__�s
zPurePath.__eq__cCs2y|jStk
r,tt|j��|_|jSXdS)N)r�r��hashr�r�)r+r r r!�__hash__�s
zPurePath.__hash__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r+r�r r r!�__lt__�szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r+r�r r r!�__le__szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r+r�r r r!�__gt__szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r+r�r r r!�__ge__
szPurePath.__ge__r�z.The drive prefix (letter or UNC path), if any.)�docr�zThe root of the path, if any.cCs|j|j}|S)N)r�r�)r+�anchorr r r!rszPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)Nr?rr-rM)r�rQr�r�)r+r8r r r!r�sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)Nr.rr?r-)r��rfindrQ)r+r�rIr r r!�suffix#s

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)Nr.cSsg|]}d|�qS)r.r )rHr	r r r!r[<sz%PurePath.suffixes.<locals>.<listcomp>r?)r��endswithrSr3)r+r�r r r!�suffixes1s


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)Nr.rr?)r�rrQ)r+r�rIr r r!�stem>s

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjgksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)Nz%r has an empty namerMr?zInvalid name %r)r�r�r�r>r)r/rQr�r�r�r�)r+r�r9r:r8r r r!�	with_nameHszPurePath.with_namecCs�|j}|j|ks |jr.|j|kr.td|f��|r<|�d�rD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|�|j	|j
|jdd�|g�S)NzInvalid suffix %rr.z%r has an empty namerM)r�r)r/r�ror�r	rQr�r�r�r�)r+r	r�r�Z
old_suffixr r r!�with_suffixSs
zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|�|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|s�|r�n||d|
��||	�kr�|�|||�}t	d�
t|�t|����|�d|
dkr�|nd||
d��S)Nzneed at least one argumentr?rz{!r} does not start with {!r}r-)
r�r�r�r�r�rQr�r\r�r�r�rer�)
r+r�r8r9r:Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�n�cf�	formattedr r r!�relative_tohs(	*zPurePath.relative_tocCs.y|jStk
r(t|j�|_|jSXdS)N)r�r�r�r�)r+r r r!r8�s
zPurePath.partscGs
|�|�S)N)r�)r+r�r r r!�joinpath�szPurePath.joinpathcCs|�|f�S)N)r�)r+�keyr r r!�__truediv__�szPurePath.__truediv__cCs|�|g|j�S)N)r�r�)r+rr r r!�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)Nr?rM)r�r�r�rQr�)r+r9r:r8r r r!�parent�szPurePath.parentcCst|�S)N)r�)r+r r r!�parents�szPurePath.parentscCs|js
dS|jjpt|j�S)NF)r�r�r��boolr�)r+r r r!r��szPurePath.is_absolutecCs|j�|j�S)N)r�rsr�)r+r r r!rs�szPurePath.is_reservedc	Cs�|jj}||�}|j�|f�\}}}|s0td��|rF|||j�krFdS|r\|||j�kr\dS|j}|sj|r�t|�t|�kr~dS|dd�}nt|�t|�kr�dSx.tt	|�t	|��D]\}}t
�||�s�dSq�WdS)Nz
empty patternFr?T)r�r@r>r�r�r�r�rQ�zipr0r_Zfnmatchcase)	r+Zpath_patternrr9r:Z	pat_partsr8r<r&r r r!r��s(zPurePath.matchN)T)T)/rBrCrDr�r�r��classmethodr�r�r�r�r�r�r�r�rur�r�r��propertyr�r�rrrrrrrtr:rr�r	rrr
rrr8rrrrrr�rsr�r r r r!rlsZ

	
	

 
c@seZdZeZdZdS)rr N)rBrCrD�_posix_flavourr�r�r r r r!r�sc@seZdZeZdZdS)rr N)rBrCrD�_windows_flavourr�r�r r r r!r�sc@s�eZdZdZdd�Zdadd�Zdd�Zd	d
�Zdd�Zd
d�Z	dbdd�Z
dcdd�Zedd��Z
edd��Zdd�Zdd�Zdd�Zdd �Zd!d"�Zddd$d%�Zd&d'�Zd(d)�Zd*d+�Zded.d/�Zd0d1�Zdfd2d3�Zd4d5�Zdgd6d7�Zdhd9d:�Zdid;d<�Zd=d>�Zd?d@�Z dAdB�Z!dCdD�Z"dEdF�Z#dGdH�Z$dIdJ�Z%djdKdL�Z&dMdN�Z'dOdP�Z(dQdR�Z)dSdT�Z*dUdV�Z+dWdX�Z,dYdZ�Z-d[d\�Z.d]d^�Z/d_d`�Z0dS)kr)r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF)r�z$cannot instantiate %r on your system)rrfr�rrr�r�r�r�rBr�)r�r��kwargsr+r r r!r�szPath.__new__NcCs"d|_|dk	r|j|_nt|_dS)NF)rr��_normal_accessor)r+�templater r r!r�
s
z
Path._initcCs|j|g}|�|j|j|�S)N)r�r�r�r�)r+r<r8r r r!r�szPath._make_child_relpathcCs|jr|��|S)N)r�
_raise_closed)r+r r r!�	__enter__szPath.__enter__cCs
d|_dS)NT)r)r+�t�v�tbr r r!�__exit__sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�)r+r r r!r#"szPath._raise_closed�cCs|j�|||�S)N)r�r�)r+r��flagsr�r r r!�_opener%szPath._opener�cCs|jr|��|j�|||�S)N)rr#r�r�)r+r*r�r r r!�	_raw_open)szPath._raw_opencCs|t���S)N)rfrg)r�r r r!�cwd4szPath.cwdcCs||�j�d��S)N)r�r�)r�r r r!�home;sz	Path.homecCsB|��}y|��}Wntk
r2t�|�}YnXtj�||�S)N)r�r�rfrj�samestat)r+Z
other_path�stZother_str r r!�samefileBsz
Path.samefileccsL|jr|��x8|j�|�D](}|dkr*q|�|�V|jr|��qWdS)N>�..r.)rr#r�r�r�)r+r�r r r!�iterdirMszPath.iterdirccsd|std�|���|j�|f�\}}}|s.|r6td��tt|�|j�}x|�|�D]
}|VqRWdS)NzUnacceptable pattern: {!r}z%Non-relative patterns are unsupported)r�r�r�r>r�r�r�r�)r+rcr9r:r��selectorrZr r r!�glob[sz	Path.globccsV|j�|f�\}}}|s|r$td��tdt|�|j�}x|�|�D]
}|VqDWdS)Nz%Non-relative patterns are unsupported)z**)r�r>r�r�r�r�)r+rcr9r:r�r5rZr r r!�rglobhsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)NF)r�)r")rr#r�r�rfrgr�r�)r+�objr r r!�absolutetsz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)N)rkF)r�)r")rr#r�rmr�rer9r��normpathr�r�)r+rkrYZnormedr8r r r!rm�szPath.resolvecCs|j�|�S)N)r�r�)r+r r r!r��sz	Path.statcCsddl}|�|��j�jS)Nr)r�r�r��st_uidZpw_name)r+r�r r r!�owner�sz
Path.ownercCsddl}|�|��j�jS)Nr)�grpZgetgrgidr��st_gidZgr_name)r+r=r r r!�group�sz
Path.group�rrMc	Cs(|jr|��tj|||||||jd�S)N)�opener)rr#�ior�r+)r+r��	buffering�encoding�errors�newliner r r!r��sz	Path.openc	Cs |jdd��
}|��SQRXdS)N�rb)r�)r��read)r+r�r r r!�
read_bytes�szPath.read_bytesc	Cs$|jd||d��
}|��SQRXdS)Nr@)r�rDrE)r�rH)r+rDrEr�r r r!�	read_text�szPath.read_textc	Cs*t|�}|jdd��}|�|�SQRXdS)N�wb)r�)�
memoryviewr��write)r+�dataZviewr�r r r!�write_bytes�szPath.write_bytesc	Cs@t|t�std|jj��|jd||d��}|�|�SQRXdS)Nzdata must be str, not %s�w)r�rDrE)r�rer�r�rBr�rM)r+rNrDrEr�r r r!�
write_text�s

zPath.write_textTcCsr|jr|��|r>y|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dS)N)rr#r�r�r�rf�O_CREAT�O_WRONLY�O_EXCLr-�close)r+r��exist_okr*�fdr r r!�touch�s
z
Path.touchcCs�|jr|��y|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)NT)rrVF)rr#r�r�rirr�r�)r+r�rrVr r r!r��sz
Path.mkdircCs |jr|��|j�||�dS)N)rr#r�r�)r+r�r r r!r�sz
Path.chmodcCs |jr|��|j�||�dS)N)rr#r�r�)r+r�r r r!r�
szPath.lchmodcCs|jr|��|j�|�dS)N)rr#r�r�)r+r r r!r�szPath.unlinkcCs|jr|��|j�|�dS)N)rr#r�r�)r+r r r!r�sz
Path.rmdircCs|jr|��|j�|�S)N)rr#r�r�)r+r r r!r�'sz
Path.lstatcCs |jr|��|j�||�dS)N)rr#r�r�)r+r�r r r!r�0szPath.renamecCs |jr|��|j�||�dS)N)rr#r�r1)r+r�r r r!r18szPath.replacecCs"|jr|��|j�|||�dS)N)rr#r�r�)r+r�r�r r r!�
symlink_toAszPath.symlink_toc
Cs>y|��Wn,tk
r8}zt|�s(�dSd}~XYnXdS)NFT)r�r�r")r+r�r r r!r�LszPath.existsc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)r	r��st_moder�r")r+r�r r r!r�XszPath.is_dirc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)rr�rZr�r")r+r�r r r!�is_fileeszPath.is_filecCst|��r|��sdSt|j�}y|��j}Wntk
r@dSX|��j}||krXdS|��j}|��j}||kS)NFT)r�r�rrr��st_devr��st_ino)r+rZ
parent_devZdevZinoZ
parent_inor r r!�is_mountss



z
Path.is_mountc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)r
r�rZr�r")r+r�r r r!r��szPath.is_symlinkc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)r
r�rZr�r")r+r�r r r!�is_block_device�szPath.is_block_devicec
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)rr�rZr�r")r+r�r r r!�is_char_device�szPath.is_char_devicec
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)rr�rZr�r")r+r�r r r!�is_fifo�szPath.is_fifoc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)NF)rr�rZr�r")r+r�r r r!�	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)Nrr?�~)r�r�r�r�r�r�)r+Zhomedirr r r!�
expanduser�s
zPath.expanduser)N)r))r,)F)r@rMNNN)NN)NN)r)T)r,FF)F)1rBrCrDr�r�r�r�r$r(r#r+r-rr.r/r2r4r6r7r9rmr�r<r?r�rIrJrOrQrXr�r�r�r�r�r�r�r1rYr�r�r[r^r�r_r`rarbrdr r r r!r�s\








	



				





c@seZdZdZdS)rr N)rBrCrDr�r r r r!r�sc@s(eZdZdZdd�Zdd�Zdd�ZdS)	rr cCstd��dS)Nz*Path.owner() is unsupported on this system)r�)r+r r r!r<�szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this system)r�)r+r r r!r?�szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this system)r�)r+r r r!r^�szWindowsPath.is_mountN)rBrCrDr�r<r?r^r r r r!r�s)Ar_�	functoolsrBr�rfr�r]r5�_collections_abcrrrrrrr�operatorrr�r	r
rrr
rrZurllib.parserrvr�r�rZgetwindowsversionr�__all__rrr"r'r�r(rEr�rrr�r�r!r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrr r r r!�<module>sp$

?(f1
,n

e