AlkantarClanX12

Your IP : 18.219.18.238


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

B

YI~dޣ�@s�ddlZddlZddlZddlZddlZddlZyddlZ[dZWnek
rZdZYnXyddl	Z	[	dZ
Wnek
r�dZ
YnXyddlZ[dZWnek
r�dZYnXyddl
mZWnek
r�dZYnXyddlmZWnek
�rdZYnXdddd	d
ddd
dddddddddddddddddgZGdd�de�ZGd d�de�ZGd!d�de�ZGd"d�de�ZGd#d$�d$e�ZGd%d&�d&e�Zd�d(d�Zd)d*�Zdd+�d,d�Zdd+�d-d�Zeed.��r�dd+�d/d0�Znd1d0�Zdd+�d2d	�Z dd+�d3d
�Z!dd+�d4d�Z"d5d�Z#dde"dfd6d�Z$d7d8�Z%d9d:�Z&ej'ejej(ej)hej*k�ozej+ej,k�ozejej-kZ.d�d;d�Z/e.e/_0d<d=�Z1e"fd>d
�Z2d?d@�Z3dAdB�Z4dCdD�Z5d�dFdG�Z6d�dHdI�Z7dJe6dKgdLfiZ8e�re6dMgdNfe8dO<e7gdPfe8dQ<e
�re6dRgdSfe8dT<e�r,e6dUgdVfe8dW<dXd�Z9d�dZd�Z:d[d�Z;d�d\d�Z<d]d�Z=d^d_�Z>d�d`d�Z?dad�Z@dbdc�ZAddde�ZBdfdg�ZCdhgeCgdLfdigeBgdPfdj�ZDe�r�dkdlgeCgdNfeDdO<e
�r�dmdngeCgdSfeDdT<e�r�dodpgeCgdVfeDdW<dqdr�ZEd�dsd�ZFeedt��rLe�Gdu�e�Hdvdw�ZIdxeIjJ_KdyeIjL_KdzeIjM_Kd{du�ZNn2ejOd|k�r~ddlPZPe�Gdu�e�Hdvdw�ZId}du�ZNd�d~d�ZQd�d�d�ZRejSejTBdfd�d�ZUdS)��NTF)�getpwnam)�getgrnam�copyfileobj�copyfile�copymode�copystat�copy�copy2�copytree�move�rmtree�Error�SpecialFileError�	ExecError�make_archive�get_archive_formats�register_archive_format�unregister_archive_format�get_unpack_formats�register_unpack_format�unregister_unpack_format�unpack_archive�ignore_patterns�chown�which�get_terminal_size�
SameFileErrorc@seZdZdS)r
N)�__name__�
__module__�__qualname__�r r �+/opt/alt/python37/lib64/python3.7/shutil.pyr
7sc@seZdZdS)rN)rrrr r r r!r:sc@seZdZdS)rN)rrrr r r r!r=sc@seZdZdS)rN)rrrr r r r!rAsc@seZdZdS)�	ReadErrorN)rrrr r r r!r"Dsr"c@seZdZdS)�
RegistryErrorN)rrrr r r r!r#Gsr#�@cCs$x|�|�}|sP|�|�qWdS)N)�read�write)�fsrc�fdst�length�bufr r r!rLs

cCsXttjd�r0ytj�||�Stk
r.dSXtj�tj�|��tj�tj�|��kS)N�samefileF)�hasattr�os�pathr+�OSError�normcase�abspath)�src�dstr r r!�	_samefileTsr4)�follow_symlinksc
Cs�t||�rtd�||���xL||gD]@}yt�|�}Wntk
rJYq$Xt�|j�r$td|��q$W|s�tj	�
|�r�t�t�|�|�n6t
|d��&}t
|d��}t||�WdQRXWdQRX|S)Nz{!r} and {!r} are the same filez`%s` is a named pipe�rb�wb)r4r�formatr-�statr/�S_ISFIFO�st_moderr.�islink�symlink�readlink�openr)r2r3r5�fn�str'r(r r r!r`s
cCsx|s<tj�|�r<tj�|�r<ttd�r6tjtj}}qZdSnttd�rVtjtj}}ndS||�}||t�|j	��dS)N�lchmod�chmod)
r-r.r<r,�lstatrBr9rC�S_IMODEr;)r2r3r5Z	stat_funcZ
chmod_funcrAr r r!r}s

�	listxattrcCs�ytj||d�}Wn:tk
rL}z|jtjtjtjfkr<�dSd}~XYnXxr|D]j}y&tj|||d�}tj||||d�WqTtk
r�}z |jtj	tjtjtjfkr��Wdd}~XYqTXqTWdS)N)r5)
r-rFr/�errno�ENOTSUPZENODATAZEINVAL�getxattr�setxattrZEPERM)r2r3r5�names�e�name�valuer r r!�
_copyxattr�s	

rOcOsdS)Nr )�args�kwargsr r r!rO�sc	
s6ddd�dd��|p,tj�|�o*tj�|�}|r@�fdd�}n�fdd�}|d�||d�}t�|j�}|d	�||j|jf|d�t|||d�y|d
�|||d�Wnt	k
r�YnXt
|d��r2y|d�||j|d�WnPtk
�r0}z0x*d
D] }t
t
|�r�|j
tt
|�kr�Pq�W�Wdd}~XYnXdS)N)�nsr5cWsdS)Nr )rRr5rPr r r!�_nop�szcopystat.<locals>._nopcstt|��S)N)�getattrr-)rM)rSr r!�lookup�szcopystat.<locals>.lookupcstt|��}|tjkr|S�S)N)rTr-�supports_follow_symlinks)rMr@)rSr r!rU�s
r9)r5�utimerC�st_flagsZchflags)Z
EOPNOTSUPPrH)r-r.r<r9rEr;�st_atime_ns�st_mtime_nsrO�NotImplementedErrorr,rXr/rGrT)	r2r3r5ZfollowrUrA�mode�why�errr )rSr!r�s,
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)N)r5)r-r.�isdir�join�basenamerr)r2r3r5r r r!r�s
cCsBtj�|�r"tj�|tj�|��}t|||d�t|||d�|S)N)r5)r-r.r_r`rarr)r2r3r5r r r!r	�s
cs�fdd�}|S)Ncs,g}x�D]}|�t�||��q
Wt|�S)N)�extend�fnmatch�filter�set)r.rK�
ignored_names�pattern)�patternsr r!�_ignore_patternss
z)ignore_patterns.<locals>._ignore_patternsr )rhrir )rhr!rscCs�t�|�}|dk	r|||�}nt�}t�|�g}�x@|D�]6}	|	|krJq:tj�||	�}
tj�||	�}y�tj�|
�r�t�|
�}|r�t�||�t	|
||d�n:tj�
|�s�|r�w:tj�|
�r�t|
||||�n
||
|�n(tj�|
�r�t|
||||�n
||
|�Wq:t
k
�r:}
z|�|
jd�Wdd}
~
XYq:tk
�rp}z|�|
|t|�f�Wdd}~XYq:Xq:Wyt	||�WnJtk
�r�}z*t|dd�dk�r�|�||t|�f�Wdd}~XYnX|�r�t
|��|S)N)r5rZwinerror)r-�listdirre�makedirsr.r`r<r>r=r�existsr_r
r
rbrPr/�append�strrT)r2r3�symlinks�ignore�
copy_functionZignore_dangling_symlinksrKrf�errorsrMZsrcnameZdstname�linktor^r]r r r!r
sL$



 *&c	CsPy"t�|��}t|�}WdQRXWn*tk
rL|tj|t���g}YnXx�|D]�}|j}y|jdd�}Wntk
r�d}YnX|r�y|��r�td��Wn*tk
r�|tjj	|t���wTYnXt
||�qTyt�|�WqTtk
�r|tj|t���YqTXqTWyt�|�Wn(tk
�rJ|tj|t���YnXdS)NF)r5z%Cannot call rmtree on a symbolic link)
r-�scandir�listr/�sys�exc_infor.�is_dir�
is_symlinkr<�_rmtree_unsafe�unlink�rmdir)r.�onerror�
scandir_it�entries�entry�fullnamerxr r r!rzts8


rzc
Cs�y"t�|��}t|�}WdQRXWn:tk
r\}z||_|tj|t���dSd}~XYnX�x�|D�]�}tj�||j	�}y,|j
dd�}|r�|jdd�}	t�|	j
�}Wntk
r�d}YnX|�r�ytj|j	tj|d�}
Wn(tk
�r|tj|t���Yn�Xz�tj�|	t�|
���rnt|
||�ytj|j	|d�Wn(tk
�rj|tj|t���YnXn8ytd��Wn*tk
�r�|tjj|t���YnXWdt�|
�Xqfytj|j	|d�Wqftk
�r�|tj|t���YqfXqfWdS)NF)r5)�dir_fdz%Cannot call rmtree on a symbolic link)r-rtrur/�filenamervrwr.r`rMrxr9�S_ISDIRr;r?�O_RDONLY�samestat�fstat�_rmtree_safe_fdr|r<�closer{)�topfdr.r}r~rr^r�r�rx�orig_st�dirfdr r r!r��sJ
r�c	Cs�|rdd�}n|dkrdd�}t�rPt|t�r8t�|�}yt�|�}Wn&tk
rl|tj|t���dSXyt�	|tj
�}Wn&tk
r�|tj|t���dSXz�tj�|t�
|���rt|||�yt�|�Wn(tk
�r|tj|t���YnXn8ytd��Wn*tk
�r<|tjj|t���YnXWdt�|�XnPytj�|��rhtd��Wn*tk
�r�|tjj|t���dSXt||�SdS)NcWsdS)Nr )rPr r r!r}�szrmtree.<locals>.onerrorcWs�dS)Nr )rPr r r!r}�sz%Cannot call rmtree on a symbolic link)�_use_fd_functions�
isinstance�bytesr-�fsdecoderD�	Exceptionrvrwr?r�r.r�r�r�r|r/r<r�rz)r.�
ignore_errorsr}r��fdr r r!r�sH


cCs&tjjtjjpd}tj�|�|��S)N�)r-r.�sep�altsepra�rstrip)r.r�r r r!�	_basename
sr�c	Cs|}tj�|�rTt||�r*t�||�dStj�|t|��}tj�|�rTtd|��yt�||�Wn�t	k
r�tj�
|�r�t�|�}t�||�t�
|�nTtj�|�r�t||�r�td||f��t|||dd�t|�n|||�t�
|�YnX|S)Nz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.T)rqro)r-r.r_r4�renamer`r�rlr
r/r<r>r=r{�
_destinsrcr
r)r2r3rqZreal_dstrsr r r!rs2




cCsVtj�|�}tj�|�}|�tjj�s2|tjj7}|�tjj�sL|tjj7}|�|�S)N)r-r.r1�endswithr��
startswith)r2r3r r r!r�Hsr�cCsNtdks|dkrdSyt|�}Wntk
r8d}YnX|dk	rJ|dSdS)N�)r�KeyError)rM�resultr r r!�_get_gidQs
r�cCsNtdks|dkrdSyt|�}Wntk
r8d}YnX|dk	rJ|dSdS)Nr�)rr�)rMr�r r r!�_get_uid]s
r��gzipcs |dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntd�|���ddl}	|rfd	|nd}
|d
|
}tj�|�}|r�tj�	|�s�|dk	r�|�
d|�|s�t�|�|dk	r�|�
d�t���t
�������fd
d�}
|�s|	�|d|�}z|j||
d�Wd|��X|S)Nr�r�Zgz�bzip2�bz2�xzzCbad value for 'compress', or compression format not supported : {0}r�.z.tarzcreating %szCreating tar archivecs,�dk	r�|_�|_�dk	r(�|_�|_|S)N)�gidZgname�uid�uname)Ztarinfo)r��group�ownerr�r r!�_set_uid_gid�sz#_make_tarball.<locals>._set_uid_gidzw|%s)rd)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorr8�tarfiler-r.�dirnamerl�inforkr�r�r?�addr�)�	base_name�base_dir�compress�verbose�dry_runr�r��loggerZtar_compressionr�Zcompress_extZarchive_name�archive_dirr��tarr )r�r�r�r�r!�
_make_tarballis<

	
r�c	Cszddl}|d}tj�|�}|rNtj�|�sN|dk	r@|�d|�|sNt�|�|dk	rd|�d||�|�sv|j|d|jd���}tj�	|�}	|	tj
kr�|�|	|	�|dk	r�|�d|	�x�t�|�D]�\}
}}xFt
|�D]:}
tj�	tj�|
|
��}	|�|	|	�|dk	r�|�d|	�q�WxT|D]L}
tj�	tj�|
|
��}	tj�|	��r|�|	|	�|dk	�r|�d|	��qWq�WWdQRX|S)Nrz.zipzcreating %sz#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler-r.r�rlr�rk�ZipFileZZIP_DEFLATED�normpath�curdirr&�walk�sortedr`�isfile)r�r�r�r�r�r�Zzip_filenamer�Zzfr.�dirpathZdirnames�	filenamesrMr r r!�
_make_zipfile�s@



 r�r�)r�Nzuncompressed tar file)r�r�zgzip'ed tar-fileZgztarzZIP file�zip)r�r�zbzip2'ed tar-fileZbztar)r�r�zxz'ed tar-fileZxztarcCsdd�t��D�}|��|S)NcSsg|]\}}||df�qS)r�r )�.0rM�registryr r r!�
<listcomp>�sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort)�formatsr r r!r�sr�cCsx|dkrg}t|�s td|��t|ttf�s6td��x.|D]&}t|ttf�rZt|�dkr<td��q<W|||ft|<dS)NzThe %s object is not callablez!extra_args needs to be a sequencer�z+extra_args elements are : (arg_name, value))�callable�	TypeErrorr��tupleru�lenr�)rM�function�
extra_args�descriptionZelementr r r!r�s	
cCs
t|=dS)N)r�)rMr r r!rsc	
Cst��}	|dk	r>|dk	r$|�d|�tj�|�}|s>t�|�|dkrLtj}||d�}
yt|}Wn"tk
r�t	d|�d�YnX|d}x|dD]\}
}||
|
<q�W|dkr�||
d<||
d<z|||f|
�}Wd|dk	r�|dk	r�|�d	|	�t�|	�X|S)
Nzchanging into '%s')r�r�zunknown archive format '%s'r�r�r�r�zchanging back to '%s')
r-�getcwd�debugr.r1�chdirr�r�r�r�)r�r8Zroot_dirr�r�r�r�r�r�Zsave_cwdrQ�format_info�func�arg�valr�r r r!r	s6

cCsdd�t��D�}|��|S)NcSs"g|]\}}||d|df�qS)r�r )r�rMr�r r r!r�Fsz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSr�r�)r�r r r!r@sc	Csvi}x.t��D]"\}}x|dD]}|||<q WqWx,|D]$}||kr:d}t||||f��q:Wt|�srtd��dS)Nrz!%s is already registered for "%s"z*The registered function must be a callable)r�r�r#r�r�)	�
extensionsr�r�Zexisting_extensionsrMr��ext�	extension�msgr r r!�_check_unpack_optionsKs
r�cCs,|dkrg}t|||�||||ft|<dS)N)r�r�)rMr�r�r�r�r r r!r]scCs
t|=dS)N)r�)rMr r r!rsscCs&tj�|�}tj�|�s"t�|�dS)N)r-r.r�r_rk)r.r�r r r!�_ensure_directorywsr�c		Cs�ddl}|�|�std|��|�|�}z�x�|��D]�}|j}|�d�s4d|krRq4tjj	|f|�
d���}|spq4t|�|�d�s4|�
|j�}t|d�}z|�|�Wd|��~Xq4WWd|��XdS)Nrz%s is not a zip file�/z..r7)r�Z
is_zipfiler"r�Zinfolistr�r�r-r.r`�splitr�r�r%r?r&r�)	r��extract_dirr�r�r�rM�target�data�fr r r!�_unpack_zipfile}s*



r�cCsXddl}y|�|�}Wn"|jk
r8td|��YnXz|�|�Wd|��XdS)Nrz/%s is not a compressed or uncompressed tar file)r�r?ZTarErrorr"Z
extractallr�)r�r�r�Ztarobjr r r!�_unpack_tarfile�sr�z.tarz.zip)r�r�z.tar.gzz.tgzz.tar.bz2z.tbz2z.tar.xzz.txzcCs:x4t��D](\}}x|dD]}|�|�r|SqWq
WdS)Nr)r�r�r�)r�rMr�r�r r r!�_find_unpack_format�s

r�cCs�|dkrt��}t�|�}t�|�}|dk	r~yt|}Wn$tk
r\td�|��d�YnX|d}|||ft|d��nHt|�}|dkr�t	d�|���t|d}tt|d�}|||f|�dS)NzUnknown unpack format '{0}'r�r�zUnknown archive format '{0}')
r-r��fspathr�r�r�r8�dictr�r")r�r�r8r�r�rQr r r!r�s"

�statvfs�
disk_usage�usageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@t�|�}|j|j}|j|j}|j|j|j}t|||�S)N)r-r��f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)r.rA�free�total�usedr r r!r��s

�ntcCs"t�|�\}}||}t|||�S)N)r�Z
_getdiskusager�)r.r�r�r�r r r!r�scCs�|dkr|dkrtd��|}|}|dkr.d}n(t|t�rVt|�}|dkrVtd�|���|dkrdd}n(t|t�s�t|�}|dkr�td�|���t�	|||�dS)Nzuser and/or group must be set���zno such user: {!r}zno such group: {!r})
r�r�rnr��LookupErrorr8�intr�r-r)r.�userr�Z_user�_groupr r r!rs"

��P�c
Cs�yttjd�}Wnttfk
r.d}YnXyttjd�}Wnttfk
r^d}YnX|dksp|dkr�yt�tj���}Wn$t	tt
fk
r�t�|�}YnX|dkr�|j}|dkr�|j
}t�||f�S)N�COLUMNSrZLINES)rr-�environr�r�rrv�
__stdout__�fileno�AttributeErrorr/�
terminal_size�columns�lines)�fallbackr
r�sizer r r!r1s$

c	s^dd�}tj���r&|�|�r"�SdS|dkrrtj�dd�}|dkrryt�d�}Wnttfk
rptj}YnX|szdS|�	tj
�}tjdkr�tj
|kr�|�dtj
�tj�dd��	tj
�}t�fd	d
�|D��r܈g}q��fdd�|D�}n�g}t�}x\|D]T}tj�|�}||k�r|�|�x,|D]$}	tj�||	�}
||
|��r,|
S�q,W�qWdS)
NcSs&tj�|�o$t�||�o$tj�|�S)N)r-r.rl�accessr_)r@r\r r r!�
_access_checkkszwhich.<locals>._access_check�PATH�CS_PATH�win32rZPATHEXTr�c3s |]}����|���VqdS)N)�lowerr�)r�r�)�cmdr r!�	<genexpr>�szwhich.<locals>.<genexpr>csg|]}�|�qSr r )r�r�)rr r!r��szwhich.<locals>.<listcomp>)r-r.r�r�get�confstrrr��defpathr��pathseprv�platformr��insert�anyrer0r�r`)rr\r.rZpathext�files�seen�dirZnormdirZthefilerMr )rr!r^sB







)r$)FN)r�rrNNN)rrN)Nr�)NNrrNNN)Nr�)NN)NN)r)Vr-rvr9rc�collectionsrG�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrpr�__all__r/r
rrrr"r�r#rr4rrr,rOrrr	rr
rzr�r?r{r|�supports_dir_fdrt�supports_fdrVr�rZavoids_symlink_attacksr�rr�r�r�r�r�r�rrrrrr�rrr�r�r�r�r�rrm�
namedtupler�r��__doc__r�r�r�rMr�rr�F_OK�X_OKrr r r r!�<module>s�






<Y#/

=8	
@
-





6
"






(




-