ok

Mini Shell

Direktori : /opt/alt/python36/lib64/python3.6/__pycache__/
Upload File :
Current File : //opt/alt/python36/lib64/python3.6/__pycache__/pathlib.cpython-36.opt-2.pyc

3

��2aV��@sVddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZmZddlmZddlmZmZmZmZmZmZmZddlmZdZejd	kr�ddlZej �dd
�d5kr�ddlm!Z!q�d
ZdZ!ndZddddddgZ"dd�Z#Gdd�de$�Z%Gdd�de%�Z&Gdd�de%�Z'e&�Z(e'�Z)Gdd�d�Z*Gdd�de*�Z+e+�Z,d d!�Z-e.ed"��r�ej/�e-�Z-Gd#d$�d$�Z0Gd%d&�d&�Z1Gd'd(�d(e0�Z2Gd)d*�d*e0�Z3Gd+d,�d,e0�Z4Gd-d.�d.e	�Z5Gd/d�de$�Z6ej7j8e6�Gd0d�de6�Z9Gd1d�de6�Z:Gd2d�de6�Z;Gd3d�de;e9�Z<Gd4d�de;e:�Z=dS)6�N)�Sequence)�contextmanager)�EINVAL�ENOENT�ENOTDIR)�
attrgetter)�S_ISDIR�S_ISLNK�S_ISREG�S_ISSOCK�S_ISBLK�S_ISCHR�S_ISFIFO)�quote_from_bytesT�nt��)�_getfinalpathnameF�PurePath�
PurePosixPath�PureWindowsPath�Path�	PosixPath�WindowsPathcCsd|kpd|kpd|kS)N�*�?�[�)�patrr�,/opt/alt/python36/lib64/python3.6/pathlib.py�_is_wildcard_pattern&sr c@s$eZdZdd�Zdd�Zdd�ZdS)�_FlavourcCs|jj|_dS)N)�sep�join)�selfrrr�__init__0sz_Flavour.__init__cCs g}|j}|j}d}}t|�}x�|D]�}|s0q&|r@|j||�}|j|�\}}}	||	kr�xPt|	j|��D] }
|
rh|
dkrh|jtj|
��qhWn|	r�|	dkr�|jtj|	��|s�|r&|s�x6|D].}|s�q�|r�|j||�}|j|�d}|r�Pq�WPq&W|�s|�r|j||�|j	�|||fS)N��.r)
r"�altsep�reversed�replace�	splitroot�split�append�sys�intern�reverse)r$�partsZparsedr"r(�drv�root�it�partZrel�xrrr�parse_parts3s@

z_Flavour.parse_partscCs||r,|rr|rr||||g|dd�fSnF|rd||ksL|j|�|j|�krr||||dd�fSn||||fS|||fS)N�)�casefold)r$r2r3r1Zdrv2Zroot2Zparts2rrr�join_parsed_partsYs
z_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__r%r7r:rrrrr!,s&r!c@s�eZdZdZdZdZeZej	dkZ
edd�ee
d�e
d�d	�D��ed
d�ee
d�e
d�d	�D��BZd
Zddddhdd�ed	d�D�Bdd�ed	d�D�BZefdd�Zdd�Zdd�Zd*dd�Zefdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)S)+�_WindowsFlavour�\�/Trccs|]}t|�VqdS)N)�chr)�.0r6rrr�	<genexpr>wsz_WindowsFlavour.<genexpr>�a�zr8ccs|]}t|�VqdS)N)rA)rBr6rrrrCxs�A�Zz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr)rB�irrr�	<setcomp>~sz_WindowsFlavour.<setcomp>�
cCsh|]}d|�qS)zLPT%dr)rBrHrrrrIscCsb|dd�}|dd�}||krP||krP|j|�\}}|dd�}|dd�}nd}|dd�}||kov||kov||k�r|j|d�}|dk�r|j||d�}||dk�r|dkr�t|�}|r�||d|�|||dd�fS|d|�|||dd�fSd}	}
|dk�r<||jk�r<|dd�}	|dd�}|}||k�rT|}
|j|�}||	|
|fS)	Nrr8rr&��:���rM)�_split_extended_path�find�len�
drive_letters�lstrip)r$r5r"�first�second�prefixZthird�indexZindex2r2r3rrrr+�s6
"

z_WindowsFlavour.splitrootcCs|j�S)N)�lower)r$�srrrr9�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|j��qSr)rW)rB�prrr�
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r)r$r1rrr�casefold_parts�sz_WindowsFlavour.casefold_partsFcCs�t|�}|stj�Sd}tdk	r�|r2|jt|��Sg}xly|jt|��}Wn>tk
r�|}tjj|�\}}|j|�||kr�|SYq8Xtjj	|ft
|���Sq8WdS)N)�str�os�getcwdr�_ext_to_normal�FileNotFoundError�pathr,r-r#r))r$ra�strictrXZ
previous_sZ
tail_parts�tailrrr�resolve�s&

z_WindowsFlavour.resolvecCsXd}|j|�rP|dd�}|dd�}|jd�rP||dd�7}d|dd�}||fS)Nr&�zUNC\rKr?)�
startswith)r$rXZ
ext_prefixrUrrrrN�s

z$_WindowsFlavour._split_extended_pathcCs|j|�dS)Nr8)rN)r$rXrrrr_�sz_WindowsFlavour._ext_to_normalcCs6|sdS|djd�rdS|djd�dj�|jkS)NFrz\\r8r'rM)rf�	partition�upper�reserved_names)r$r1rrr�is_reserved�s
z_WindowsFlavour.is_reservedcCsd|j}t|�dkrJ|ddkrJ|j�dd�jd�}d|t|jd��fSdt|j�jd��SdS)Nrr8rLr@z
file:///%s/%szutf-8zfile:)�driverP�as_posixrR�urlquote_from_bytes�encode)r$rark�restrrr�make_uri�sz_WindowsFlavour.make_uric
Cs�dtjkrtjd}n`dtjkr,tjd}nJdtjkrnytjd}Wntk
r\d}YnX|tjd}ntd��|r�tjd|kr�|j|f�\}}}|d
tjdkr�td	|��||d<|s�|r�|||j|dd��}n
|j|�}|S)N�HOMEZUSERPROFILEZHOMEPATHZ	HOMEDRIVEr&zCan't determine home directoryZUSERNAMEr8z%Can't determine home directory for %rrMrM)r]�environ�KeyError�RuntimeErrorr7r#)r$�username�userhomer2r3r1rrr�
gethomedir�s,




z_WindowsFlavour.gethomedirN)F)r;r<r=r"r(�has_drv�ntpath�pathmodr]�name�is_supported�set�range�ordrQZext_namespace_prefixrir+r9r[rdrNr_rjrprwrrrrr>ks&
"&	'

r>c@sdeZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
ddd�Zd
d�Zdd�Zdd�ZdS)�
_PosixFlavourr@r&FrcCsV|rH|d|krH|j|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr&)rRrP)r$r5r"Z
stripped_partrrrr+s
z_PosixFlavour.splitrootcCs|S)Nr)r$rXrrrr9)sz_PosixFlavour.casefoldcCs|S)Nr)r$r1rrrr[,sz_PosixFlavour.casefold_partscsJ|j�|j�i������fdd��|j�r0dntj�}�|t|��pH�S)Ncs�|j��rd}x�|j��D]�}|s|dkr.q|dkrH|j��\}}}q|�|}|�krz�|}|dk	rnqtd|��y�j|�}Wn6tk
r�}z|jtkr��r��|}WYdd}~XqXd�|<�||�}|�|<qW|S)Nr&r'z..zSymlink loop from %r)rfr,�
rpartitionrt�readlink�OSError�errnor)raror{�_�newpath�target�e)�_resolve�accessor�seenr"rbrrr�3s0

z'_PosixFlavour.resolve.<locals>._resolver&)r"�	_accessor�is_absoluter]r^r\)r$rarb�baser)r�r�r�r"rbrrd/s&z_PosixFlavour.resolvecCsdS)NFr)r$r1rrrrj\sz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesrm)r$raZbpathrrrrp_sz_PosixFlavour.make_uricCst|s:y
tjdStk
r6ddl}|jtj��jSXn6ddl}y|j|�jStk
rntd|��YnXdS)Nrqrz%Can't determine home directory for %r)	r]rrrs�pwd�getpwuid�getuid�pw_dir�getpwnamrt)r$rur�rrrrwes
z_PosixFlavour.gethomedirN)F)r;r<r=r"r(rx�	posixpathrzr]r{r|r+r9r[rdrjrprwrrrrr�s

-r�c@seZdZdS)�	_AccessorN)r;r<r=rrrrr�ysr�c@s�eZdZdd�Zdd�Zeej�Zeej�Zeej�Zeej	�Z	eej
�Z
eej�Zeed�rjeej
�Z
ndd�Z
eej�Zeej�Zeej�Zeej�Zeej�Zer�er�eej�Zq�dd	�Zned
d	��Zeej�Zdd�Zd
S)�_NormalAccessorcstj���fdd��}t|�S)Ncs�t|�f|��S)N)r\)�pathobj�args)�strfuncrr�wrapped�sz._NormalAccessor._wrap_strfunc.<locals>.wrapped)�	functools�wraps�staticmethod)r�r�r)r�r�
_wrap_strfunc�sz_NormalAccessor._wrap_strfunccstj���fdd��}t|�S)Ncs�t|�t|�f|��S)N)r\)ZpathobjAZpathobjBr�)r�rrr��sz5_NormalAccessor._wrap_binary_strfunc.<locals>.wrapped)r�r�r�)r�r�r)r�r�_wrap_binary_strfunc�sz$_NormalAccessor._wrap_binary_strfunc�lchmodcCstd��dS)Nz%lchmod() not available on this system)�NotImplementedError)r$r��moderrrr��sz_NormalAccessor.lchmodcCstd��dS)Nz&symlink() not available on this system)r�)rD�b�target_is_directoryrrr�symlink�sz_NormalAccessor.symlinkcCstjt|�t|��S)N)r]r�r\)rDr�r�rrrr��scCs
tj|�S)N)r]r�)r$rarrrr��sz_NormalAccessor.readlinkN)r;r<r=r�r�r]�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlink�rmdir�renamer*r�supports_symlinksr�r��utimer�rrrrr�~s.













r�cCsP|d}|dd�}|dkr"t}n$d|kr4td��nt|�rBt}nt}|||�S)Nrr8z**z:Invalid pattern: '**' can only be an entire path component)�_RecursiveWildcardSelector�
ValueErrorr �_WildcardSelector�_PreciseSelector)�
pattern_partsr�child_parts�clsrrr�_make_selector�s
r��	lru_cachec@seZdZdd�Zdd�ZdS)�	_SelectorcCs.||_|rt|�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r$r�rrrr%�s
z_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|j||||�S)N)�type�is_dir�existsr�r��iter�_select_from)r$�parent_pathZpath_clsr�r�r�rrr�select_from�sz_Selector.select_fromN)r;r<r=r%r�rrrrr��s	r�c@seZdZdd�ZdS)r�ccs
|VdS)Nr)r$r�r�r�r�rrrr��sz!_TerminatingSelector._select_fromN)r;r<r=r�rrrrr��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_tj||�dS)N)r{r�r%)r$r{r�rrrr%�sz_PreciseSelector.__init__ccs^yD|j|j�}|jr|n||�rBx |jj||||�D]
}|Vq4WWntk
rXdSXdS)N)�_make_child_relpathr{r�r�r��PermissionError)r$r�r�r�r�rarYrrrr��sz_PreciseSelector._select_fromN)r;r<r=r%r�rrrrr��sr�c@seZdZdd�Zdd�ZdS)r�cCs"tjtj|��|_tj||�dS)N)�re�compile�fnmatch�	translaterr�r%)r$rr�rrrr%sz_WildcardSelector.__init__ccs�y||jj}t||��}xb|D]Z}|js0|j�r|j}||�}	|jj|	�r|j|�}
x |j	j
|
|||�D]
}|VqhWqWWntk
r�dSXdS)N)�_flavourr9�listr�r�r{r�matchr�r�r�r�)r$r�r�r�r��cf�entries�entryr{Z
casefoldedrarYrrrr�s

z_WildcardSelector._select_fromN)r;r<r=r%r�rrrrr�sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCstj||�dS)N)r�r%)r$rr�rrrr%sz#_RecursiveWildcardSelector.__init__ccsz|VyZt||��}xH|D]@}|j�r|j�r|j|j�}x|j|||�D]
}|VqLWqWWntk
rtdSXdS)N)r�r��
is_symlinkr�r{�_iterate_directoriesr�)r$r�r�r�r�r�rarYrrrr�s
z/_RecursiveWildcardSelector._iterate_directoriesc	cs�yjt�}zT|jj}xF|j|||�D]4}x.|||||�D]}||kr6|V|j|�q6Wq"WWd|j�XWntk
r~dSXdS)N)r}r�r�r��add�clearr�)	r$r�r�r�r�ZyieldedZsuccessor_selectZstarting_pointrYrrrr�*sz'_RecursiveWildcardSelector._select_fromN)r;r<r=r%r�r�rrrrr�sr�c@s0eZdZdZdd�Zdd�Zd	d
�Zdd�Zd
S)�_PathParents�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dS)N)r�r�r�r�r�)r$rarrrr%Cs
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdS)Nr8)r�r�rPr�)r$rrr�__len__Jsz_PathParents.__len__cCs@|dks|t|�krt|��|jj|j|j|jd|d��S)Nrr8)rP�
IndexErrorr��_from_parsed_partsr�r�r�)r$�idxrrr�__getitem__Psz_PathParents.__getitem__cCsdj|jj�S)Nz<{}.parents>)�formatr�r;)r$rrr�__repr__Vsz_PathParents.__repr__N)r�r�r�r�)r;r<r=�	__slots__r%r�r�r�rrrrr�>s
r�c@s�eZdZdYZdd	�Zd
d�Zedd
��ZedZdd��Zed[dd��Z	edd��Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd �Zd!d"�Zd#d$�Zed%d&��Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zeed�d3d4�Zeed�d5d4�Zed6d7��Zed8d9��Zed:d;��Z ed<d=��Z!ed>d?��Z"d@dA�Z#dBdC�Z$dDdE�Z%edFdG��Z&dHdI�Z'dJdK�Z(dLdM�Z)edNdO��Z*edPdQ��Z+dRdS�Z,dTdU�Z-dVdW�Z.dXS)\rr�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|j|�S)Nr)rr]r{rr�_from_parts)r�r�rrr�__new__hszPurePath.__new__cCs|jt|j�fS)N)�	__class__�tupler�)r$rrr�
__reduce__rszPurePath.__reduce__cCshg}xV|D]N}t|t�r$||j7}q
tj|�}t|t�rH|jt|��q
tdt|���q
W|j	j
|�S)NzNargument should be a str object or an os.PathLike object returning str, not %r)�
isinstancerr�r]�fspathr\r-�	TypeErrorr�r�r7)r�r�r1rDrrr�_parse_argsws



zPurePath._parse_argsTcCs<tj|�}|j|�\}}}||_||_||_|r8|j�|S)N)�objectr�r�r�r�r��_init)r�r��initr$r2r3r1rrrr��s
zPurePath._from_partscCs,tj|�}||_||_||_|r(|j�|S)N)r�r�r�r�r�r�)r�r2r3r1r�r$rrrr��s
zPurePath._from_parsed_partscCs4|s|r$|||jj|dd��S|jj|�SdS)Nr8)r�r#)r�r2r3r1rrr�_format_parsed_parts�szPurePath._format_parsed_partscCsdS)Nr)r$rrrr��szPurePath._initcCs@|j|�\}}}|jj|j|j|j|||�\}}}|j|||�S)N)r�r�r:r�r�r�r�)r$r�r2r3r1rrr�_make_child�szPurePath._make_childcCs<y|jStk
r6|j|j|j|j�p,d|_|jSXdS)Nr')r��AttributeErrorr�r�r�r�)r$rrr�__str__�szPurePath.__str__cCst|�S)N)r\)r$rrr�
__fspath__�szPurePath.__fspath__cCs|j}t|�j|jd�S)Nr@)r�r\r*r")r$�frrrrl�szPurePath.as_posixcCstjt|��S)N)r]�fsencoder\)r$rrr�	__bytes__�szPurePath.__bytes__cCsdj|jj|j��S)Nz{}({!r}))r�r�r;rl)r$rrrr��szPurePath.__repr__cCs|j�std��|jj|�S)Nz.relative path can't be expressed as a file URI)r�r�r�rp)r$rrr�as_uri�szPurePath.as_uricCs2y|jStk
r,|jj|j�|_|jSXdS)N)r�r�r�r[r�)r$rrr�_cparts�s
zPurePath._cpartscCs&t|t�stS|j|jko$|j|jkS)N)r�r�NotImplementedr�r�)r$�otherrrr�__eq__�s
zPurePath.__eq__cCs2y|jStk
r,tt|j��|_|jSXdS)N)r�r��hashr�r�)r$rrr�__hash__�s
zPurePath.__hash__cCs(t|t�s|j|jk	rtS|j|jkS)N)r�rr�r�r�)r$rrrr�__lt__�szPurePath.__lt__cCs(t|t�s|j|jk	rtS|j|jkS)N)r�rr�r�r�)r$rrrr�__le__�szPurePath.__le__cCs(t|t�s|j|jk	rtS|j|jkS)N)r�rr�r�r�)r$rrrr�__gt__�szPurePath.__gt__cCs(t|t�s|j|jk	rtS|j|jkS)N)r�rr�r�r�)r$rrrr�__ge__�szPurePath.__ge__z.The drive prefix (letter or UNC path), if any.)�doczThe root of the path, if any.cCs|j|j}|S)N)r�r�)r$�anchorrrrr	szPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)Nr8rr&rM)r�rPr�r�)r$r1rrrr{	sz
PurePath.namecCsD|j}|jd�}d|ko*t|�dknr<||d�SdSdS)Nr'rr8r&)r{�rfindrP)r$r{rHrrr�suffixs

 zPurePath.suffixcCs:|j}|jd�rgS|jd�}dd�|jd�dd�D�S)Nr'cSsg|]}d|�qS)r'r)rBrrrrrZ"sz%PurePath.suffixes.<locals>.<listcomp>r8)r{�endswithrRr,)r$r{rrr�suffixess


zPurePath.suffixescCsD|j}|jd�}d|ko*t|�dknr<|d|�S|SdS)Nr'rr8)r{r
rP)r$r{rHrrr�stem$s

 z
PurePath.stemcCs�|jstd|f��|jj|f�\}}}|sZ|d|jj|jjgksZ|sZ|sZt|�dkrftd|��|j|j|j	|j
dd�|g�S)Nz%r has an empty namer8zInvalid name %rrMrM)r{r�r�r7r"r(rPr�r�r�r�)r$r{r2r3r1rrr�	with_name.szPurePath.with_namecCs�|j}|j|ks |jr,|j|kr,td|��|r<|jd�sD|dkrPtd|��|j}|shtd|f��|j}|s|||}n|dt|��|}|j|j	|j
|jdd�|g�S)NzInvalid suffix %rr'z%r has an empty namer8rM)r�r"r(r�rfr{rrPr�r�r�r�)r$rr�r{Z
old_suffixrrr�with_suffix9s
zPurePath.with_suffixc
Gs�|std��|j}|j}|j}|r8||g|dd�}n|}|j|�\}}}|rf||g|dd�}	n|}	t|	�}
|jj}|
dkr�|p�|n||d|
��||	�kr�|j|||�}t	dj
t|�t|����|jd|
dkr�|nd||
d��S)Nzneed at least one argumentr8rz{!r} does not start with {!r}r&)
r�r�r�r�r�rPr�r[r�r�r�r\r�)
r$rr1r2r3Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�nr��	formattedrrr�relative_toNs(	(zPurePath.relative_tocCs.y|jStk
r(t|j�|_|jSXdS)N)r�r�r�r�)r$rrrr1ns
zPurePath.partscGs
|j|�S)N)r�)r$r�rrr�joinpathzszPurePath.joinpathcCs|j|f�S)N)r�)r$�keyrrr�__truediv__�szPurePath.__truediv__cCs|j|g|j�S)N)r�r�)r$rrrr�__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|j|||dd��S)Nr8rM)r�r�r�rPr�)r$r2r3r1rrr�parent�szPurePath.parentcCst|�S)N)r�)r$rrr�parents�szPurePath.parentscCs|js
dS|jjpt|j�S)NF)r�r�rx�boolr�)r$rrrr��szPurePath.is_absolutecCs|jj|j�S)N)r�rjr�)r$rrrrj�szPurePath.is_reservedc	Cs�|jj}||�}|jj|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
j||�s�dSq�WdS)Nz
empty patternFr8T)r�r9r7r�r�r�r�rP�zipr)r�Zfnmatchcase)	r$Zpath_patternr�r2r3Z	pat_partsr1r5rrrrr��s(zPurePath.matchN)r�r�r�r�r�r�r�)T)T)/r;r<r=r�r�r��classmethodr�r�r�r�r�r�r�r�rlr�r�r��propertyr�rrrrrrrrkr3r	r{rr
rrrrr1rrrrrr�rjr�rrrrrZs\

	
	
	
 
c@seZdZeZfZdS)rN)r;r<r=�_posix_flavourr�r�rrrrr�sc@seZdZeZfZdS)rN)r;r<r=�_windows_flavourr�r�rrrrr�sc@s�eZdZd`Zdd�Zdadd�Zdd	�Zd
d�Zdd
�Zdd�Z	dbdd�Z
dcdd�Zedd��Z
edd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zddd%d&�Zd'd(�Zd)d*�Zd+d,�Zdfd/d0�Zd1d2�Zdgd3d4�Zd5d6�Zdhd7d8�Zdid:d;�Zdjd<d=�Zd>d?�Zd@dA�Z dBdC�Z!dDdE�Z"dFdG�Z#dHdI�Z$dJdK�Z%dkdLdM�Z&dNdO�Z'dPdQ�Z(dRdS�Z)dTdU�Z*dVdW�Z+dXdY�Z,dZd[�Z-d\d]�Z.d^d_�Z/dS)lrr��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|j
�|S)NrF)r�z$cannot instantiate %r on your system)rr]r{rrr�r�r|r�r;r�)r�r��kwargsr$rrrr��szPath.__new__NcCs"d|_|dk	r|j|_nt|_dS)NF)r r��_normal_accessor)r$�templaterrrr��s
z
Path._initcCs|j|g}|j|j|j|�S)N)r�r�r�r�)r$r5r1rrrr��szPath._make_child_relpathcCs|jr|j�|S)N)r �
_raise_closed)r$rrr�	__enter__szPath.__enter__cCs
d|_dS)NT)r )r$�t�v�tbrrr�__exit__sz
Path.__exit__cCstd��dS)NzI/O operation on closed path)r�)r$rrrr$szPath._raise_closed�cCs|jj|||�S)N)r�r�)r$r{�flagsr�rrr�_openerszPath._opener�cCs|jr|j�|jj|||�S)N)r r$r�r�)r$r+r�rrr�	_raw_openszPath._raw_opencCs|tj��S)N)r]r^)r�rrr�cwdszPath.cwdcCs||�jjd��S)N)r�rw)r�rrr�home!sz	Path.homecCsB|j�}y|j�}Wntk
r2tj|�}YnXtjj||�S)N)r�r�r]ra�samestat)r$Z
other_path�stZother_strrr�samefile(sz
Path.samefileccsL|jr|j�x8|jj|�D](}|dkr*q|j|�V|jr|j�qWdS)Nr'�..>r4r')r r$r�r�r�)r$r{rrr�iterdir3szPath.iterdirccsl|stdj|���|jj|�}|jj|f�\}}}|s:|rBtd��tt|��}x|j|�D]
}|VqZWdS)NzUnacceptable pattern: {!r}z%Non-relative patterns are unsupported)	r�r�r�r9r7r�r�r�r�)r$�patternr2r3r��selectorrYrrr�globAsz	Path.globccs^|jj|�}|jj|f�\}}}|s(|r0td��tdt|��}x|j|�D]
}|VqLWdS)Nz%Non-relative patterns are unsupported�**)r9)r�r9r7r�r�r�r�)r$r6r2r3r�r7rYrrr�rglobOsz
Path.rglobcCsD|jr|j�|j�r|S|jtj�g|jdd�}|j|d�|S)NF)r�)r#)r r$r�r�r]r^r�r�)r$�objrrr�absolute[sz
Path.absoluteFcCsh|jr|j�|jj||d�}|dkr:|j�t|j��}|jjj|�}|j	|fdd�}|j
|d�|S)N)rbF)r�)r#)r r$r�rdr�r\r<rz�normpathr�r�)r$rbrXZnormedr;rrrrdmszPath.resolvecCs|jj|�S)N)r�r�)r$rrrr��sz	Path.statcCsddl}|j|j�j�jS)Nr)r�r�r��st_uidZpw_name)r$r�rrr�owner�sz
Path.ownercCsddl}|j|j�j�jS)Nr)�grpZgetgrgidr��st_gidZgr_name)r$r@rrr�group�sz
Path.group�rr8c	Cs,|jr|j�tjt|�||||||jd�S)N)�opener)r r$�ior�r\r,)r$r��	buffering�encoding�errors�newlinerrrr��sz	Path.openc	Cs |jdd��
}|j�SQRXdS)N�rb)r�)r��read)r$r�rrr�
read_bytes�szPath.read_bytesc	Cs$|jd||d��
}|j�SQRXdS)NrC)r�rGrH)r�rK)r$rGrHr�rrr�	read_text�szPath.read_textc	Cs*t|�}|jdd��}|j|�SQRXdS)N�wb)r�)�
memoryviewr��write)r$�dataZviewr�rrr�write_bytes�szPath.write_bytesc	Cs@t|t�std|jj��|jd||d��}|j|�SQRXdS)Nzdata must be str, not %s�w)r�rGrH)r�r\r�r�r;r�rP)r$rQrGrHr�rrr�
write_text�s

zPath.write_textTcCsr|jr|j�|r>y|jj|d�Wntk
r8YnXdStjtjB}|sX|tjO}|j	||�}tj
|�dS)N)r r$r�r�r�r]�O_CREAT�O_WRONLY�O_EXCLr.�close)r$r��exist_okr+�fdrrr�touch�s
z
Path.touchcCs�|jr|j�y|jj||�Wnjtk
rf|s@|j|krB�|jjddd�|j|d|d�Yn&tk
r�|s�|j�r��YnXdS)NT)rrYF)r r$r�r�r`rr�r�)r$r�rrYrrrr��sz
Path.mkdircCs |jr|j�|jj||�dS)N)r r$r�r�)r$r�rrrr��sz
Path.chmodcCs |jr|j�|jj||�dS)N)r r$r�r�)r$r�rrrr��szPath.lchmodcCs|jr|j�|jj|�dS)N)r r$r�r�)r$rrrr��szPath.unlinkcCs|jr|j�|jj|�dS)N)r r$r�r�)r$rrrr�sz
Path.rmdircCs|jr|j�|jj|�S)N)r r$r�r�)r$rrrr�sz
Path.lstatcCs |jr|j�|jj||�dS)N)r r$r�r�)r$r�rrrr�szPath.renamecCs |jr|j�|jj||�dS)N)r r$r�r*)r$r�rrrr*szPath.replacecCs"|jr|j�|jj|||�dS)N)r r$r�r�)r$r�r�rrr�
symlink_to(szPath.symlink_tocCsBy|j�Wn0tk
r<}z|jttfkr.�dSd}~XnXdS)NFT)r�r�r�rr)r$r�rrrr�3szPath.existscCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)rr��st_moder�r�rr)r$r�rrrr�?szPath.is_dircCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)r
r�r]r�r�rr)r$r�rrr�is_fileLszPath.is_filecCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)r	r�r]r�r�rr)r$r�rrrr�ZszPath.is_symlinkcCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)rr�r]r�r�rr)r$r�rrr�is_block_devicefszPath.is_block_devicecCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)r
r�r]r�r�rr)r$r�rrr�is_char_devicesszPath.is_char_devicecCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)rr�r]r�r�rr)r$r�rrr�is_fifo�szPath.is_fifocCsDyt|j�j�Stk
r>}z|jttfkr0�dSd}~XnXdS)NF)rr�r]r�r�rr)r$r�rrr�	is_socket�szPath.is_socketcCsb|jp
|jr^|jr^|jddd�dkr^|jj|jddd��}|j|g|jdd��S|S)Nrr8�~)r�r�r�r�rwr�)r$Zhomedirrrr�
expanduser�s
zPath.expanduser)r�r )N)r*)r-)FrM)rCrMNNN)NN)NN)r*T)r-FF)F)0r;r<r=r�r�r�r�r%r)r$r,r.rr/r0r3r5r8r:r<rdr�r?rBr�rLrMrRrTr[r�r�r�r�r�r�r�r*r\r�r�r^r�r_r`rarbrdrrrrr�s\







	



				





c@seZdZfZdS)rN)r;r<r=r�rrrrr�sc@s eZdZfZdd�Zdd�ZdS)rcCstd��dS)Nz*Path.owner() is unsupported on this system)r�)r$rrrr?�szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this system)r�)r$rrrrB�szWindowsPath.groupN)r;r<r=r�r?rBrrrrr�s)rr)>r�r�rEryr]r�r�r.�collectionsr�
contextlibrr�rrr�operatorrr�rr	r
rrr
rZurllib.parserrmr�r{rZgetwindowsversionr�__all__r r�r!r>r�rrr�r�r"r�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrrrrr�<module>sl$

?(c=
%f

Q

Zerion Mini Shell 1.0