HEX
Server: Apache/2.4.62 (Debian)
System: Linux MIA-VPS-VM01781 5.10.0-32-amd64 #1 SMP Debian 5.10.223-1 (2024-08-10) x86_64
User: webmaster (1001)
PHP: 8.2.29
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3.7/__pycache__/pathlib.cpython-37.pyc
B

U��e��@sdddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZmZm
Z
mZddlmZddlmZmZmZmZmZmZmZddlmZdZejdkr�ddlZe��dd	�d
kr�ddlm Z q�dZdZ ndZd
dddddgZ!ee
efZ"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#�Z/e0ed$��r�e�1�e/�Z/Gd%d&�d&�Z2Gd'd(�d(�Z3Gd)d*�d*e2�Z4Gd+d,�d,e2�Z5Gd-d.�d.e2�Z6Gd/d0�d0e	�Z7Gd1d
�d
e&�Z8ej9�:e8�Gd2d�de8�Z;Gd3d�de8�Z<Gd4d�de8�Z=Gd5d�de=e;�Z>Gd6d�de=e<�Z?dS)7�N)�Sequence)�EINVAL�ENOENT�ENOTDIR�EBADF)�
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)�cCs t|dd�tkpt|dd�tkS)N�errnoZwinerror)�getattr�_IGNORED_ERROS�_IGNORED_WINERRORS)Z	exception�r�/usr/lib/python3.7/pathlib.py�
_ignore_error,sr!cCsd|kpd|kpd|kS)N�*�?�[r)�patrrr �_is_wildcard_pattern1sr&c@s(eZdZdZdd�Zdd�Zdd�ZdS)	�_FlavourzPA flavour implements a particular (platform-specific) set of path
    semantics.cCs|jj|_dS)N)�sep�join)�selfrrr �__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�xrrr �parse_parts>s@


z_Flavour.parse_partscCsz|r*|sp|rp||||g|dd�fSnF|rb||ksJ|�|�|�|�krp||||dd�fSn||||fS|||fS)z�
        Join the two paths represented by the respective
        (drive, root, parts) tuples.  Return a new (drive, root, parts) tuple.
        �N)�casefold)r*r8r9r7Zdrv2Zroot2Zparts2rrr �join_parsed_partsdsz_Flavour.join_parsed_partsN)�__name__�
__module__�__qualname__�__doc__r+r=r@rrrr r'7s&r'c@s�eZdZdZdZdZeZej	dkZ
ed�ZdZ
ddd	d
hdd�ed
d�D�Bdd�ed
d�D�BZefdd�Zdd�Zdd�Zd$dd�Ze
fdd�Zdd�Zdd�Zdd �Zd!d"�Zd#S)%�_WindowsFlavour�\�/TrZ4abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZz\\?\ZCONZPRNZAUXZNULcCsh|]}d|�qS)zCOM%dr)�.0�irrr �	<setcomp>�sz_WindowsFlavour.<setcomp>r>�
cCsh|]}d|�qS)zLPT%dr)rHrIrrr 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�indexZindex2r8r9rrr r1�s6"

z_WindowsFlavour.splitrootcCs|��S)N)�lower)r*�srrr r?�sz_WindowsFlavour.casefoldcCsdd�|D�S)NcSsg|]}|���qSr)rX)rH�prrr �
<listcomp>�sz2_WindowsFlavour.casefold_parts.<locals>.<listcomp>r)r*r7rrr �casefold_parts�sz_WindowsFlavour.casefold_partsFcCs�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�pathr2r3r)r/)r*rb�strictrYZ
previous_sZ
tail_parts�tailrrr �resolve�s&

z_WindowsFlavour.resolvecCsXd}|�|�rP|dd�}|dd�}|�d�rP||dd�7}d|dd�}||fS)Nr,�zUNC\rLrF)�
startswith)r*rYZ
ext_prefixrVrrr rO�s

z$_WindowsFlavour._split_extended_pathcCs|�|�dS)Nr>)rO)r*rYrrr r`�sz_WindowsFlavour._ext_to_normalcCs6|sdS|d�d�rdS|d�d�d��|jkS)NFrz\\rMr-)rg�	partition�upper�reserved_names)r*r7rrr �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*rbrl�restrrr �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>)r^�environ�KeyError�RuntimeErrorr=r))r*�username�userhomer8r9r7rrr �
gethomedir�s,




z_WindowsFlavour.gethomedirN)F)rArBrCr(r.�has_drv�ntpath�pathmodr^�name�is_supported�setrRZext_namespace_prefix�rangerjr1r?r\rerOr`rkrqrxrrrr rEvs$
	'

rEc@sdeZdZdZdZdZeZej	dkZ
efdd�Zdd�Zd	d
�Z
ddd�Zd
d�Zdd�Zdd�ZdS)�
_PosixFlavourrGr,FrcCsV|rH|d|krH|�|�}t|�t|�dkr<d|d|fSd||fSn
dd|fSdS)Nrrr,)rSrQ)r*r;r(Z
stripped_partrrr r1"s
z_PosixFlavour.splitrootcCs|S)Nr)r*rYrrr r?1sz_PosixFlavour.casefoldcCs|S)Nr)r*r7rrr r\4sz_PosixFlavour.casefold_partscsJ|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)rgr2�
rpartitionru�readlink�OSErrorrr)rbrpr|�_�newpath�target�e)�_resolve�accessor�seenr(rcrr r�;s0

z'_PosixFlavour.resolve.<locals>._resolver,)r(�	_accessor�is_absoluter^r_r])r*rbrc�baser)r�r�r�r(rcr re7s&z_PosixFlavour.resolvecCsdS)NFr)r*r7rrr rkdsz_PosixFlavour.is_reservedcCst|�}dt|�S)Nzfile://)�bytesrn)r*rbZbpathrrr rqgsz_PosixFlavour.make_uricCst|s:y
tjdStk
r6ddl}|�t���jSXn6ddl}y|�|�jStk
rntd|��YnXdS)Nrrrz%Can't determine home directory for %r)	r^rsrt�pwd�getpwuid�getuid�pw_dir�getpwnamru)r*rvr�rrr rxms
z_PosixFlavour.gethomedirN)F)rArBrCr(r.ry�	posixpathr{r^r|r}r1r?r\rerkrqrxrrrr r�s

-r�c@seZdZdZdS)�	_AccessorzjAn accessor implements a particular (system-specific or not) way of
    accessing paths on the filesystem.N)rArBrCrDrrrr 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�moderrr r��sz_NormalAccessor.lchmodcCstd��dS)Nz&symlink() not available on this system)r�)�a�b�target_is_directoryrrr �symlink�sz_NormalAccessor.symlinkcCst�||�S)N)r^r�)r�r�r�rrr r��scCs
t�|�S)N)r^r�)r*rbrrr r��sz_NormalAccessor.readlinkN)rArBrCr^�stat�lstat�open�listdir�scandir�chmod�hasattrr��mkdir�unlink�rmdir�renamer0r�supports_symlinksr��staticmethod�utimer�rrrr r��s*

r�cCsP|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_partsr%�child_parts�clsrrr �_make_selector�s
r��	lru_cachec@s eZdZdZdd�Zdd�ZdS)�	_SelectorzYA selector matches a specific glob pattern part against the children
    of a given path.cCs.||_|rt|�|_d|_nt�|_d|_dS)NTF)r�r��	successor�dironly�_TerminatingSelector)r*r�rrr r+�s
z_Selector.__init__cCs<t|�}|j}|j}|jj}||�s,tg�S|�||||�S)zuIterate over all child paths of `parent_path` matched by this
        selector.  This can contain parent_path itself.)�type�is_dir�existsr�r��iter�_select_from)r*�parent_pathZpath_clsr�r�r�rrr �select_from�sz_Selector.select_fromN)rArBrCrDr+r�rrrr r��s	r�c@seZdZdd�ZdS)r�ccs
|VdS)Nr)r*r�r�r�r�rrr r��sz!_TerminatingSelector._select_fromN)rArBrCr�rrrr r��sr�c@seZdZdd�Zdd�ZdS)r�cCs||_t�||�dS)N)r|r�r+)r*r|r�rrr 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�rbrZrrr r��sz_PreciseSelector._select_fromN)rArBrCr+r�rrrr r��sr�c@seZdZdd�Zdd�ZdS)r�cCs"t�t�|��|_t�||�dS)N)�re�compile�fnmatch�	translater%r�r+)r*r%r�rrr r+sz_WildcardSelector.__init__ccs�yz|jj}t||��}x`|D]X}|jr.|��r|j}||�}	|j�|	�r|�|�}
x |j	�
|
|||�D]
}|VqfWqWWntk
r�dSXdS)N)�_flavourr?�listr�r�r|r%�matchr�r�r�r�)r*r�r�r�r��cf�entries�entryr|Z
casefoldedrbrZrrr r�s

z_WildcardSelector._select_fromN)rArBrCr+r�rrrr r��sr�c@s$eZdZdd�Zdd�Zdd�ZdS)r�cCst�||�dS)N)r�r+)r*r%r�rrr r+sz#_RecursiveWildcardSelector.__init__c
cs�|Vy�t||��}x�|D]x}d}y|��}Wn,tk
rZ}zt|�sJ�Wdd}~XYnX|r|��s|�|j�}x|�|||�D]
}	|	Vq�WqWWntk
r�dSXdS)NF)	r�r�r�r!�
is_symlinkr�r|�_iterate_directoriesr�)
r*r�r�r�r�r�Zentry_is_dirr�rbrZrrr 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_pointrZrrr r�,sz'_RecursiveWildcardSelector._select_fromN)rArBrCr+r�r�rrrr r�sr�c@s4eZdZdZdZdd�Zdd�Zdd�Zd	d
�ZdS)�_PathParentszvThis object provides sequence-like access to the logical ancestors
    of a path.  Don't try to construct it yourself.)�_pathcls�_drv�_root�_partscCs&t|�|_|j|_|j|_|j|_dS)N)r�r�r�r�r�)r*rbrrr r+Es
z_PathParents.__init__cCs(|js|jrt|j�dSt|j�SdS)Nr>)r�r�rQr�)r*rrr �__len__Lsz_PathParents.__len__cCs@|dks|t|�krt|��|j�|j|j|jd|d��S)Nrr>)rQ�
IndexErrorr��_from_parsed_partsr�r�r�)r*�idxrrr �__getitem__Rsz_PathParents.__getitem__cCsd�|jj�S)Nz<{}.parents>)�formatr�rA)r*rrr �__repr__Xsz_PathParents.__repr__N)	rArBrCrD�	__slots__r+r�r�r�rrrr r�@sr�c@s�eZdZdZdZdd�Zdd�Zedd��ZedVd
d��Z	edWdd
��Z
edd��Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zed d!��Zd"d#�Zd$d%�Zd&d'�Zd(d)�Zd*d+�Zd,d-�Zeed.�d/d0�Zeed1�d2d0�Zed3d4��Zed5d6��Z ed7d8��Z!ed9d:��Z"ed;d<��Z#d=d>�Z$d?d@�Z%dAdB�Z&edCdD��Z'dEdF�Z(dGdH�Z)dIdJ�Z*edKdL��Z+edMdN��Z,dOdP�Z-dQdR�Z.dSdT�Z/dUS)Xra|Base class for manipulating paths without I/O.

    PurePath represents a filesystem path and offers operations which
    don't imply any actual filesystem I/O.  Depending on your system,
    instantiating a PurePath will return either a PurePosixPath or a
    PureWindowsPath object.  You can also instantiate either of these classes
    directly, regardless of your system.
    )r�r�r��_str�_hash�_pparts�_cached_cpartscGs$|tkrtjdkrtnt}|�|�S)z�Construct a PurePath from one or several strings and or existing
        PurePath objects.  The strings and path objects are combined so as
        to yield a canonicalized path, which is incorporated into the
        new PurePath object.
        r)rr^r|rr�_from_parts)r��argsrrr �__new__jszPurePath.__new__cCs|jt|j�fS)N)�	__class__�tupler�)r*rrr �
__reduce__tszPurePath.__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�r^�fspathr]r3�	TypeErrorr�r�r=)r�r�r7r�rrr �_parse_argsys



zPurePath._parse_argsTcCs<t�|�}|�|�\}}}||_||_||_|r8|��|S)N)�objectr�r�r�r�r��_init)r�r��initr*r8r9r7rrr r��s
zPurePath._from_partscCs,t�|�}||_||_||_|r(|��|S)N)r�r�r�r�r�r�)r�r8r9r7r�r*rrr r��s
zPurePath._from_parsed_partscCs4|s|r$|||j�|dd��S|j�|�SdS)Nr>)r�r))r�r8r9r7rrr �_format_parsed_parts�szPurePath._format_parsed_partscCsdS)Nr)r*rrr r��szPurePath._initcCs@|�|�\}}}|j�|j|j|j|||�\}}}|�|||�S)N)r�r�r@r�r�r�r�)r*r�r8r9r7rrr �_make_child�szPurePath._make_childcCs<y|jStk
r6|�|j|j|j�p,d|_|jSXdS)z[Return the string representation of the path, suitable for
        passing to system calls.r-N)r��AttributeErrorr�r�r�r�)r*rrr �__str__�szPurePath.__str__cCst|�S)N)r])r*rrr �
__fspath__�szPurePath.__fspath__cCs|j}t|��|jd�S)zNReturn the string representation of the path with forward (/)
        slashes.rG)r�r]r0r()r*�frrr rm�szPurePath.as_posixcCs
t�|�S)zaReturn the bytes representation of the path.  This is only
        recommended to use under Unix.)r^�fsencode)r*rrr �	__bytes__�szPurePath.__bytes__cCsd�|jj|���S)Nz{}({!r}))r�r�rArm)r*rrr r��szPurePath.__repr__cCs|��std��|j�|�S)z Return the path as a 'file' URI.z.relative path can't be expressed as a file URI)r�r�r�rq)r*rrr �as_uri�szPurePath.as_uricCs2y|jStk
r,|j�|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�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r*r�rrr �__lt__�szPurePath.__lt__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r*r�rrr �__le__�szPurePath.__le__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r*r�rrr �__gt__�szPurePath.__gt__cCs&t|t�r|j|jk	rtS|j|jkS)N)r�rr�r�r�)r*r�rrr �__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)z/The concatenation of the drive and root, or ''.)r�r�)r*�anchorrrr rszPurePath.anchorcCs.|j}t|�|js|jrdndkr&dS|dS)z!The final path component, if any.r>rr,rM)r�rQr�r�)r*r7rrr r|sz
PurePath.namecCsD|j}|�d�}d|kr,t|�dkr<nn||d�SdSdS)z*The final component's last suffix, if any.r-rr>Nr,)r|�rfindrQ)r*r|rIrrr �suffixs

 zPurePath.suffixcCs:|j}|�d�rgS|�d�}dd�|�d�dd�D�S)z1A list of the final component's suffixes, if any.r-cSsg|]}d|�qS)r-r)rHrrrr r[$sz%PurePath.suffixes.<locals>.<listcomp>r>N)r|�endswithrSr2)r*r|rrr �suffixess


zPurePath.suffixescCsD|j}|�d�}d|kr,t|�dkr<nn|d|�S|SdS)z0The final path component, minus its last suffix.r-rr>N)r|rrQ)r*r|rIrrr �stem&s

 z
PurePath.stemcCs�|jstd|f��|j�|f�\}}}|rX|d|jj|jjgksX|sX|sXt|�dkrdtd|��|�|j|j	|j
dd�|g�S)z-Return a new path with the file name changed.z%r has an empty namerMr>zInvalid name %rN)r|r�r�r=r(r.rQr�r�r�r�)r*r|r8r9r7rrr �	with_name0s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)z�Return a new path with the file suffix changed.  If the path
        has no suffix, add given suffix.  If the given suffix is an empty
        string, remove the suffix from the path.
        zInvalid suffix %rr-z%r has an empty nameNrM)r�r(r.r�rgr|rrQr�r�r�r�)r*rr�r|Z
old_suffixrrr �with_suffix;s
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)z�Return the relative path to another path identified by the passed
        arguments.  If the operation is not possible (because this is not
        a subpath of the other path), raise ValueError.
        zneed at least one argumentr>Nrz{!r} does not start with {!r}r,)
r�r�r�r�r�rQr�r\r�r�r�r]r�)
r*r�r7r8r9Z	abs_partsZto_drvZto_rootZto_partsZto_abs_parts�nr�Z	formattedrrr �relative_toPs(	*zPurePath.relative_tocCs.y|jStk
r(t|j�|_|jSXdS)zZAn object providing sequence-like access to the
        components in the filesystem path.N)r�r�r�r�)r*rrr r7ps
zPurePath.partscGs
|�|�S)z�Combine this path with one or several arguments, and return a
        new path representing either a subpath (if all arguments are relative
        paths) or a totally different path (if one of the arguments is
        anchored).
        )r�)r*r�rrr �joinpath|szPurePath.joinpathcCs|�|f�S)N)r�)r*�keyrrr �__truediv__�szPurePath.__truediv__cCs|�|g|j�S)N)r�r�)r*r
rrr �__rtruediv__�szPurePath.__rtruediv__cCs@|j}|j}|j}t|�dkr*|s&|r*|S|�|||dd��S)zThe logical parent of the path.r>NrM)r�r�r�rQr�)r*r8r9r7rrr �parent�szPurePath.parentcCst|�S)z*A sequence of this path's logical parents.)r�)r*rrr �parents�szPurePath.parentscCs|js
dS|jjpt|j�S)zSTrue if the path is absolute (has both a root and, if applicable,
        a drive).F)r�r�ry�boolr�)r*rrr r��szPurePath.is_absolutecCs|j�|j�S)zaReturn True if the path contains one of the special names reserved
        by the system, if any.)r�rkr�)r*rrr rk�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)zE
        Return True if this path matches the given pattern.
        z
empty patternFr>NT)r�r?r=r�r�r�r�rQ�zipr/r�Zfnmatchcase)	r*Zpath_patternr�r8r9Z	pat_partsr7r;r%rrr r��s(zPurePath.matchN)T)T)0rArBrCrDr�r�r��classmethodr�r�r�r�r�r�r�r�rmr�r�r��propertyr�r�r�r�r�r�rrrlr9rr|rrrrr	rr7rrrrrr�rkr�rrrr r\s\
	
	
	
 
c@seZdZdZeZdZdS)rz�PurePath subclass for non-Windows systems.

    On a POSIX system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    rN)rArBrCrD�_posix_flavourr�r�rrrr r�sc@seZdZdZeZdZdS)rz�PurePath subclass for Windows systems.

    On a Windows system, instantiating a PurePath should return this object.
    However, you can also instantiate it directly on any system.
    rN)rArBrCrD�_windows_flavourr�r�rrrr r�sc@s�eZdZdZdZdd�Zdbdd�Zdd	�Zd
d�Zdd
�Z	dd�Z
dcdd�Zdddd�Ze
dd��Ze
dd��Zdd�Zdd�Zdd�Zd d!�Zd"d#�Zded%d&�Zd'd(�Zd)d*�Zd+d,�Zdfd/d0�Zd1d2�Zdgd3d4�Zd5d6�Zdhd7d8�Zdid:d;�Zdjd<d=�Zd>d?�Z d@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_�Z0d`da�Z1dS)lra�PurePath subclass that can make system calls.

    Path represents a filesystem path but unlike PurePath, also offers
    methods to do system calls on path objects. Depending on your system,
    instantiating a Path will return either a PosixPath or a WindowsPath
    object. You can also instantiate a PosixPath or WindowsPath directly,
    but cannot instantiate a WindowsPath on a POSIX system or vice versa.
    )r��_closedcOsL|tkrtjdkrtnt}|j|dd�}|jjs@td|j	f��|�
�|S)NrF)r�z$cannot instantiate %r on your system)rr^r|rrr�r�r}r�rAr�)r�r��kwargsr*rrr r��szPath.__new__NcCs"d|_|dk	r|j|_nt|_dS)NF)rr��_normal_accessor)r*�templaterrr r��s
z
Path._initcCs|j|g}|�|j|j|�S)N)r�r�r�r�)r*r;r7rrr r��szPath._make_child_relpathcCs|jr|��|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*rrr r
szPath._raise_closed�cCs|j�|||�S)N)r�r�)r*r|�flagsr�rrr �_opener
szPath._opener�cCs|jr|��|j�|||�S)zm
        Open the file pointed by this path and return a file descriptor,
        as os.open() does.
        )rrr�r�)r*r#r�rrr �	_raw_openszPath._raw_opencCs|t���S)zjReturn a new path pointing to the current working directory
        (as returned by os.getcwd()).
        )r^r_)r�rrr �cwdszPath.cwdcCs||�j�d��S)zrReturn a new path pointing to the user's home directory (as
        returned by os.path.expanduser('~')).
        N)r�rx)r�rrr �home#sz	Path.homecCsB|��}y|��}Wntk
r2t�|�}YnXtj�||�S)zoReturn whether other_path is the same or not as this file
        (as returned by os.path.samefile()).
        )r�r�r^rb�samestat)r*Z
other_path�stZother_strrr �samefile*sz
Path.samefileccsL|jr|��x8|j�|�D](}|dkr*q|�|�V|jr|��qWdS)zyIterate over the files in this directory.  Does not yield any
        result for the special paths '.' and '..'.
        >r-�..N)rrr�r�r�)r*r|rrr �iterdir5szPath.iterdirccsl|std�|���|j�|�}|j�|f�\}}}|s:|rBtd��tt|��}x|�|�D]
}|VqZWdS)z�Iterate over this subtree and yield all existing files (of any
        kind, including directories) matching the given relative pattern.
        zUnacceptable pattern: {!r}z%Non-relative patterns are unsupportedN)	r�r�r�r?r=r�r�r�r�)r*�patternr8r9r��selectorrZrrr �globCsz	Path.globccs^|j�|�}|j�|f�\}}}|s(|r0td��tdt|��}x|�|�D]
}|VqLWdS)z�Recursively yield all existing files (of any kind, including
        directories) matching the given relative pattern, anywhere in
        this subtree.
        z%Non-relative patterns are unsupported)z**N)r�r?r=r�r�r�r�)r*r.r8r9r�r/rZrrr �rglobQsz
Path.rglobcCsD|jr|��|��r|S|jt��g|jdd�}|j|d�|S)aReturn an absolute version of this path.  This function works
        even if the path doesn't point to anything.

        No normalization is done, i.e. all '.' and '..' will be kept along.
        Use resolve() to get the canonical path to a file.
        F)r�)r)rrr�r�r^r_r�r�)r*�objrrr �absolute^sz
Path.absoluteFcCsh|jr|��|jj||d�}|dkr:|��t|���}|jj�|�}|j	|fdd�}|j
|d�|S)z�
        Make the path absolute, resolving all symlinks on the way and also
        normalizing it (for example turning slashes into backslashes under
        Windows).
        )rcNF)r�)r)rrr�rer�r]r3r{�normpathr�r�)r*rcrYZnormedr2rrr repszPath.resolvecCs|j�|�S)zh
        Return the result of the stat() system call on this path, like
        os.stat() does.
        )r�r�)r*rrr r��sz	Path.statcCsddl}|�|��j�jS)z:
        Return the login name of the file owner.
        rN)r�r�r��st_uidZpw_name)r*r�rrr �owner�sz
Path.ownercCsddl}|�|��j�jS)z8
        Return the group name of the file gid.
        rN)�grpZgetgrgidr��st_gidZgr_name)r*r7rrr �group�sz
Path.group�rrMc	Cs(|jr|��tj|||||||jd�S)z|
        Open the file pointed by this path and return a file object, as
        the built-in open() function does.
        )�opener)rr�ior�r$)r*r��	buffering�encoding�errors�newlinerrr r��sz	Path.openc	Cs |jdd��
}|��SQRXdS)zK
        Open the file in bytes mode, read it, and close the file.
        �rb)r�N)r��read)r*r�rrr �
read_bytes�szPath.read_bytesc	Cs$|jd||d��
}|��SQRXdS)zJ
        Open the file in text mode, read it, and close the file.
        r:)r�r>r?N)r�rB)r*r>r?r�rrr �	read_text�szPath.read_textc	Cs*t|�}|jdd��}|�|�SQRXdS)zO
        Open the file in bytes mode, write to it, and close the file.
        �wb)r�N)�
memoryviewr��write)r*�dataZviewr�rrr �write_bytes�szPath.write_bytesc	Cs@t|t�std|jj��|jd||d��}|�|�SQRXdS)zN
        Open the file in text mode, write to it, and close the file.
        zdata must be str, not %s�w)r�r>r?N)r�r]r�r�rAr�rG)r*rHr>r?r�rrr �
write_text�s

zPath.write_textTcCsr|jr|��|r>y|j�|d�Wntk
r8YnXdStjtjB}|sX|tjO}|�	||�}t�
|�dS)zS
        Create this file with the given access mode, if it doesn't exist.
        N)rrr�r�r�r^�O_CREAT�O_WRONLY�O_EXCLr&�close)r*r��exist_okr#�fdrrr �touch�s
z
Path.touchcCs�|jr|��y|j�||�Wndtk
rd|r>|j|kr@�|jjddd�|j|d|d�Yn"tk
r�|r~|��s��YnXdS)z<
        Create a new directory at this given path.
        T)rrPFN)rrr�r�rarr�r�)r*r�rrPrrr r��sz
Path.mkdircCs |jr|��|j�||�dS)zF
        Change the permissions of the path, like os.chmod().
        N)rrr�r�)r*r�rrr r��sz
Path.chmodcCs |jr|��|j�||�dS)z�
        Like chmod(), except if the path points to a symlink, the symlink's
        permissions are changed, rather than its target's.
        N)rrr�r�)r*r�rrr r��szPath.lchmodcCs|jr|��|j�|�dS)zd
        Remove this file or link.
        If the path is a directory, use rmdir() instead.
        N)rrr�r�)r*rrr r�szPath.unlinkcCs|jr|��|j�|�dS)zF
        Remove this directory.  The directory must be empty.
        N)rrr�r�)r*rrr r�	sz
Path.rmdircCs|jr|��|j�|�S)z�
        Like stat(), except if the path points to a symlink, the symlink's
        status information is returned, rather than its target's.
        )rrr�r�)r*rrr r�sz
Path.lstatcCs |jr|��|j�||�dS)z5
        Rename this path to the given path.
        N)rrr�r�)r*r�rrr r�szPath.renamecCs |jr|��|j�||�dS)zo
        Rename this path to the given path, clobbering the existing
        destination if it exists.
        N)rrr�r0)r*r�rrr r0"szPath.replacecCs"|jr|��|j�|||�dS)z�
        Make this path a symlink pointing to the given path.
        Note the order of arguments (self, target) is the reverse of os.symlink's.
        N)rrr�r�)r*r�r�rrr �
symlink_to+szPath.symlink_toc
Cs>y|��Wn,tk
r8}zt|�s(�dSd}~XYnXdS)z+
        Whether this path exists.
        FNT)r�r�r!)r*r�rrr r�6szPath.existsc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)z3
        Whether this path is a directory.
        FN)rr��st_moder�r!)r*r�rrr r�BszPath.is_dirc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)zq
        Whether this path is a regular file (also True for symlinks pointing
        to regular files).
        FN)r
r�rTr�r!)r*r�rrr �is_fileOszPath.is_filecCst|��r|��sdSt|j�}y|��j}Wntk
r@dSX|��j}||krXdS|��j}|��j}||kS)z;
        Check if this path is a POSIX mount point
        FT)r�r�rrr��st_devr��st_ino)r*rZ
parent_devZdevZinoZ
parent_inorrr �is_mount]s



z
Path.is_mountc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)z7
        Whether this path is a symbolic link.
        FN)r	r�rTr�r!)r*r�rrr r�rszPath.is_symlinkc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)z6
        Whether this path is a block device.
        FN)rr�rTr�r!)r*r�rrr �is_block_device~szPath.is_block_devicec
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)z:
        Whether this path is a character device.
        FN)r
r�rTr�r!)r*r�rrr �is_char_device�szPath.is_char_devicec
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)z.
        Whether this path is a FIFO.
        FN)rr�rTr�r!)r*r�rrr �is_fifo�szPath.is_fifoc
Cs@yt|��j�Stk
r:}zt|�s*�dSd}~XYnXdS)z0
        Whether this path is a socket.
        FN)rr�rTr�r!)r*r�rrr �	is_socket�szPath.is_socketcCs`|js\|js\|jr\|jddd�dkr\|j�|jddd��}|�|g|jdd��S|S)zl Return a new path with expanded ~ and ~user constructs
        (as returned by os.path.expanduser)
        rNr>�~)r�r�r�r�rxr�)r*Zhomedirrrr �
expanduser�s
zPath.expanduser)N)r")r%)F)r:rMNNN)NN)NN)r"T)r%FF)F)2rArBrCrDr�r�r�r�rr!rr$r&rr'r(r+r-r0r1r3rer�r6r9r�rCrDrIrKrRr�r�r�r�r�r�r�r0rSr�r�rUrXr�rYrZr[r\r^rrrr r�s^







	



				





c@seZdZdZdZdS)rzsPath subclass for non-Windows systems.

    On a POSIX system, instantiating a Path should return this object.
    rN)rArBrCrDr�rrrr r�sc@s,eZdZdZdZdd�Zdd�Zdd�Zd	S)
rzqPath subclass for Windows systems.

    On a Windows system, instantiating a Path should return this object.
    rcCstd��dS)Nz*Path.owner() is unsupported on this system)r�)r*rrr r6�szWindowsPath.ownercCstd��dS)Nz*Path.group() is unsupported on this system)r�)r*rrr r9�szWindowsPath.groupcCstd��dS)Nz-Path.is_mount() is unsupported on this system)r�)r*rrr rX�szWindowsPath.is_mountN)rArBrCrDr�r6r9rXrrrr r�s
)@r��	functoolsr<rzr^r�r�r4�_collections_abcrrrrrr�operatorrr�rr	r
rrr
rZurllib.parserrnr�r|rZgetwindowsversionr�__all__rrr!r&r�r'rEr�rrr�r�rr�r�r�r�r�r�r�r�r�r�PathLike�registerrrrrrrrrr �<module>sp$


?%c1
+f

g