ok

Mini Shell

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

3

��f}��A@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,�d0d1�Znd2d1�Zdd,�d3d	�Z dd,�d4d
�Z!dd,�d5d�Z"d6d�Z#dde"dfd7d�Z$d8d9�Z%d:d;�Z&ej'ejej(ej)hej*k�ozej+ej,k�ozejej-kZ.d�d<d�Z/e.e/_0d=d>�Z1e"fd?d
�Z2d@dA�Z3dBdC�Z4dDdE�Z5d�dGdH�Z6d�dIdJ�Z7dKe6d�gdMfiZ8e�re6d�gdNfe8dO<e7gdPfe8dQ<e
�re6d�gdSfe8dT<e�r,e6d�gdVfe8dW<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�ZBddf�dgdh�ZCdigeCgdMfdjgeBgdPfdk�ZDe�r�dldmgeCgdNfeDdO<e
�r�dndogeCgdSfeDdT<e�r�dpdqgeCgdVfeDdW<drds�ZEd�ddf�dtd�ZFeedu��rXejGdv�ejHdwdx�ZIdyeIjJ_KdzeIjL_Kd{eIjM_Kd|dv�ZNn2ejOd}k�r�ddlPZPejGdv�ejHdwdx�ZId~dv�ZNd�dd�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 �/usr/lib64/python3.6/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#�icCs$x|j|�}|sP|j|�qWdS)N)�read�write)�fsrc�fdstZlengthZbufr r r!rLs

cCsXttjd�r0ytjj||�Stk
r.dSXtjjtjj|��tjjtjj|��kS)N�samefileF)�hasattr�os�pathr)�OSError�normcase�abspath)�src�dstr r r!�	_samefileTsr2)�follow_symlinkscCs�t||�rtdj||���xL||gD]@}ytj|�}Wntk
rJYq$Xtj|j�r$td|��q$W|r�tj	j
|�r�tjtj|�|�n6t
|d��&}t
|d��}t||�WdQRXWdQRX|S)Nz{!r} and {!r} are the same filez`%s` is a named pipe�rb�wb)r2r�formatr+�statr-�S_ISFIFO�st_moderr,�islink�symlink�readlink�openr)r0r1r3�fn�str'r(r r r!r`s
cCsz|r>tjj|�r>tjj|�r>ttd�r8tjtj}}q\dSnttd�rXtjtj}}ndS||�}||tj|j	��dS)N�lchmod�chmod)
r+r,r:r*�lstatr@r7rA�S_IMODEr9)r0r1r3Z	stat_funcZ
chmod_funcr?r r r!r}s

�	listxattrcCs�ytj||d�}Wn4tk
rF}z|jtjtjfkr8�dSd}~XnXxn|D]f}y&tj|||d�}tj||||d�WqNtk
r�}z|jtjtjtjfkr��WYdd}~XqNXqNWdS)N)r3)	r+rDr-�errno�ENOTSUPZENODATA�getxattr�setxattrZEPERM)r0r1r3�names�e�name�valuer r r!�
_copyxattr�s	
rMcOsdS)Nr )�args�kwargsr r r!rM�sc	s6ddd�dd��|p,tjj|�o*tjj|�}|r@�fdd�}n�fdd�}|d�||d�}tj|j�}|d	�||j|jf|d�y|d
�|||d�Wntk
r�YnXt	|d��r$y|d�||j
|d�WnPtk
�r"}z2x*dD] }t	t|�r�|jt
t|�kr�Pq�W�WYdd}~XnXt|||d�dS)N)�nsr3cWsdS)Nr )rPr3rNr r r!�_nop�szcopystat.<locals>._nopcstt|��S)N)�getattrr+)rK)rQr r!�lookup�szcopystat.<locals>.lookupcstt|��}|tjkr|S�S)N)rRr+�supports_follow_symlinks)rKr>)rQr r!rS�s
r7)r3�utimerA�st_flagsZchflags�
EOPNOTSUPPrF)rWrF)r+r,r:r7rCr9�st_atime_ns�st_mtime_ns�NotImplementedErrorr*rVr-rErRrM)	r0r1r3ZfollowrSr?�mode�why�errr )rQr!r�s,
cCsBtjj|�r"tjj|tjj|��}t|||d�t|||d�|S)N)r3)r+r,�isdir�join�basenamerr)r0r1r3r r r!r�s
cCsBtjj|�r"tjj|tjj|��}t|||d�t|||d�|S)N)r3)r+r,r^r_r`rr)r0r1r3r r r!r	�s
cs�fdd�}|S)Ncs,g}x�D]}|jtj||��q
Wt|�S)N)�extend�fnmatch�filter�set)r,rI�
ignored_names�pattern)�patternsr r!�_ignore_patternss
z)ignore_patterns.<locals>._ignore_patternsr )rgrhr )rgr!rscCs�tj|�}|dk	r|||�}nt�}tj|�g}�xB|D�]8}	|	|krJq:tjj||	�}
tjj||	�}y�tjj|
�r�tj|
�}|r�tj||�t	|
||d�n<tjj
|�r�|r�w:tjj|
�r�t|
||||�n
||
|�n(tjj|
�r�t|
||||�n
||
|�Wq:t
k
�r<}
z|j|
jd�WYdd}
~
Xq:tk
�rr}z|j|
|t|�f�WYdd}~Xq:Xq:Wyt	||�WnJtk
�r�}z,t|dd�dk�r�|j||t|�f�WYdd}~XnX|�r�t
|��|S)N)r3rZwinerror)r+�listdirrd�makedirsr,r_r:r<r;r�existsr^r
r
rarNr-�append�strrR)r0r1�symlinks�ignore�
copy_functionZignore_dangling_symlinksrIre�errorsrKZsrcnameZdstname�linktor]r\r r r!r
sL$



 *&c$CsLytjj|�rtd��Wn(tk
r@|tjj|tj��dSXg}ytj|�}Wn&tk
rz|tj|tj��YnXx�|D]�}tjj||�}ytj|�j	}Wntk
r�d}YnXt
j|�r�t||�q�ytj
|�Wq�tk
�r
|tj
|tj��Yq�Xq�Wytj|�Wn(tk
�rF|tj|tj��YnXdS)Nz%Cannot call rmtree on a symbolic linkr)r+r,r:r-�sys�exc_inforir_rBr9r7�S_ISDIR�_rmtree_unsafe�unlink�rmdir)r,�onerrorrIrK�fullnamer[r r r!rvqs6


rvc
0Cs�g}ytj|�}Wn:tk
rL}z||_|tj|tj��WYdd}~XnX�x�|D�]x}tjj||�}ytj||dd�}|j	}Wntk
r�d}YnXtj
|��r�ytj|tj|d�}	Wn&tk
r�|tj|tj��Yn�Xz�tjj
|tj|	���rJt|	||�ytj||d�Wn(tk
�rF|tj|tj��YnXn8ytd��Wn*tk
�r�|tjj|tj��YnXWdtj|	�XqVytj||d�WqVtk
�r�|tj|tj��YqVXqVWdS)NF)�dir_fdr3r)r{z%Cannot call rmtree on a symbolic link)r+rir-�filenamersrtr,r_r7r9rur=�O_RDONLY�samestat�fstat�_rmtree_safe_fdrxr:�closerw)
�topfdr,ryrIr]rKrz�orig_str[�dirfdr r r!r��sD$

r�c!Cs^|rdd�}n|dkrdd�}t�rPt|t�r8tj|�}ytj|�}Wn&tk
rl|tj|tj��dSXytj	|tj
�}Wn&tk
r�|tj|tj��dSXz�tjj|tj
|���rt|||�ytj|�Wn(tk
�r|tj|tj��YnXn8ytd��Wn*tk
�r<|tjj|tj��YnXWdtj|�Xn
t||�SdS)NcWsdS)Nr )rNr r r!ry�szrmtree.<locals>.onerrorcWs�dS)Nr )rNr r r!ry�sz%Cannot call rmtree on a symbolic link)�_use_fd_functions�
isinstance�bytesr+�fsdecoderB�	Exceptionrsrtr=r}r,r~rr�rxr-r:r�rv)r,�
ignore_errorsryr��fdr r r!r�s<


cCs&tjjtjjpd}tjj|j|��S)N�)r+r,�sep�altsepr`�rstrip)r,r�r r r!�	_basename�sr�cCs|}tjj|�rTt||�r*tj||�dStjj|t|��}tjj|�rTtd|��ytj||�Wn�t	k
r�tjj
|�r�tj|�}tj||�tj
|�nTtjj|�r�t||�r�td||f��t|||dd�t|�n|||�tj
|�YnX|S)Nz$Destination path '%s' already existsz.Cannot move a directory '%s' into itself '%s'.T)rprn)r+r,r^r2�renamer_r�rkr
r-r:r<r;rw�
_destinsrcr
r)r0r1rpZreal_dstrrr r r!rs2




cCsVtjj|�}tjj|�}|jtjj�s2|tjj7}|jtjj�sL|tjj7}|j|�S)N)r+r,r/�endswithr��
startswith)r0r1r r r!r�8sr�cCsNtdks|dkrdSyt|�}Wntk
r8d}YnX|dk	rJ|dSdS)N�)r�KeyError)rK�resultr r r!�_get_gidAs
r�cCsNtdks|dkrdSyt|�}Wntk
r8d}YnX|dk	rJ|dSdS)Nr�)rr�)rKr�r r r!�_get_uidMs
r��gzipc
s"|dkrd}nDtr |dkr d}n2tr2|dkr2d}n trD|dkrDd}ntdj|���ddl}	|rfd	|nd}
|d
|
}tjj|�}|r�tjj	|�r�|dk	r�|j
d|�|s�tj|�|dk	r�|j
d�t���t
�������fd
d�}
|�s|	j|d|�}z|j||
d�Wd|j�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)rc)�_ZLIB_SUPPORTED�_BZ2_SUPPORTED�_LZMA_SUPPORTED�
ValueErrorr6�tarfiler+r,�dirnamerk�inforjr�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_tarballYs<

	
r�c
Cs|ddl}|d}tjj|�}|rPtjj|�rP|dk	rB|jd|�|sPtj|�|dk	rf|jd||�|�sx|j|d|jd���}tjj	|�}	|	tj
kr�|j|	|	�|dk	r�|jd|	�x�tj|�D]�\}
}}xFt
|�D]:}
tjj	tjj|
|
��}	|j|	|	�|dk	r�|jd|	�q�WxT|D]L}
tjj	tjj|
|
��}	tjj|	��r|j|	|	�|dk	�r|jd|	��qWq�WWdQRX|S)Nrz.zipzcreating %sz#creating '%s' and adding '%s' to it�w)Zcompressionzadding '%s')�zipfiler+r,r�rkr�rj�ZipFileZZIP_DEFLATED�normpath�curdirr&�walk�sortedr_�isfile)r�r�r�r�r�r�Zzip_filenamer�Zzfr,�dirpathZdirnames�	filenamesrKr r r!�
_make_zipfile�s@



 r�r�r�zuncompressed tar filezgzip'ed tar-fileZgztarzZIP file�zipr�zbzip2'ed tar-fileZbztarr�zxz'ed tar-fileZxztarcCsdd�tj�D�}|j�|S)NcSsg|]\}}||df�qS)r�r )�.0rK�registryr r r!�
<listcomp>�sz'get_archive_formats.<locals>.<listcomp>)�_ARCHIVE_FORMATS�items�sort)�formatsr r r!r�sr�cCsz|dkrg}t|�s td|��t|ttf�s6td��x0|D](}t|ttf�s\t|�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��tuple�list�lenr�)rK�function�
extra_args�description�elementr r r!r�s	
cCs
t|=dS)N)r�)rKr r r!r�sc	Cstj�}	|dk	r>|dk	r$|jd|�tjj|�}|s>tj|�|dkrLtj}||d�}
yt|}Wn tk
r�t	d|��YnX|d}x|dD]\}
}||
|
<q�W|dkr�||
d<||
d<z|||f|
�}Wd|dk	r�|dk	r�|jd	|	�tj|	�X|S)
Nzchanging into '%s')r�r�zunknown archive format '%s'r�r�r�r�zchanging back to '%s')
r+�getcwd�debugr,r/�chdirr�r�r�r�)r�r6Zroot_dirr�r�r�r�r�r�Zsave_cwdrO�format_info�func�arg�valr|r r r!r�s6

cCsdd�tj�D�}|j�|S)NcSs"g|]\}}||d|df�qS)r�r )r�rKr�r r r!r�6sz&get_unpack_formats.<locals>.<listcomp>)�_UNPACK_FORMATSr�r�)r�r r r!r0sc	Csvi}x.tj�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_extensionsrKr��ext�	extension�msgr r r!�_check_unpack_options;s
r�cCs,|dkrg}t|||�||||ft|<dS)N)r�r�)rKr�r�r�r�r r r!rMscCs
t|=dS)N)r�)rKr r r!rcscCs&tjj|�}tjj|�s"tj|�dS)N)r+r,r�r^rj)r,r�r r r!�_ensure_directorygsr�c	Cs�ddl}|j|�std|��|j|�}z�x�|j�D]�}|j}|jd�s4d|krRq4tjj	|f|j
d���}|spq4t|�|jd�s4|j
|j�}t|d�}z|j|�Wd|j�~Xq4WWd|j�XdS)Nrz%s is not a zip file�/z..r5)r�Z
is_zipfiler"r�Zinfolistr|r�r+r,r_�splitr�r�r%r=r&r�)	r|�extract_dirr�r�r�rK�target�data�fr r r!�_unpack_zipfilems*


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

r�c
Cs�|dkrtj�}|dkri}nd|i}|dk	r�yt|}Wn"tk
r\tdj|���YnX|d}|||ft|d�|��nRt|�}|dkr�tdj|���t|d}tt|d�}|j	|�|||f|�dS)NrczUnknown unpack format '{0}'r�r�zUnknown archive format '{0}')
r+r�r�r�r�r6�dictr�r"�update)r|r�r6rcZ
filter_kwargsr�r�rOr r r!r�s&
�statvfs�
disk_usageZusageztotal used freezTotal space in byteszUsed space in byteszFree space in bytescCs@tj|�}|j|j}|j|j}|j|j|j}t|||�S)N)r+r��f_bavail�f_frsize�f_blocks�f_bfree�_ntuple_diskusage)r,r?�free�total�usedr r r!r��s

�ntcCs"tj|�\}}||}t|||�S)N)r�Z
_getdiskusager�)r,r�r�r�r r r!r��scCs�|dkr|dkrtd��|}|}|dkr.d}n(t|t�rVt|�}|dkrVtdj|���|dkrdd}n(t|t�s�t|�}|dkr�tdj|���tj	|||�dS)Nzuser and/or group must be setr�zno such user: {!r}zno such group: {!r}���r�)
r�r�rmr��LookupErrorr6�intr�r+r)r,�userr�Z_userZ_groupr r r!r	s"

�P�cCs�yttjd�}Wnttfk
r.d}YnXyttjd�}Wnttfk
r^d}YnX|dksp|dkr�ytjtjj��}Wn$t	tt
fk
r�tj|�}YnX|dkr�|j}|dkr�|j
}tj||f�S)NZCOLUMNSrZLINES)r�r+�environr�r�rrs�
__stdout__�fileno�AttributeErrorr-�
terminal_size�columns�lines)Zfallbackrr�sizer r r!r(s$

cs"dd�}tjj��r&|�|�r"�SdS|dkr>tjjdtj�}|sFdS|jtj�}tj	dkr�tj
|krt|jdtj
�tjjdd�jtj�}t�fdd	�|D��r��g}q‡fd
d�|D�}n�g}t
�}xT|D]L}tjj|�}||kr�|j|�x(|D] }	tjj||	�}
||
|�r�|
Sq�Wq�WdS)NcSs&tjj|�o$tj||�o$tjj|�S)N)r+r,rk�accessr^)r>r[r r r!�
_access_checkbszwhich.<locals>._access_check�PATHZwin32rZPATHEXTr�c3s |]}�j�j|j��VqdS)N)�lowerr�)r�r�)�cmdr r!�	<genexpr>szwhich.<locals>.<genexpr>csg|]}�|�qSr r )r�r�)r
r r!r��szwhich.<locals>.<listcomp>)r+r,r�r��get�defpathr��pathseprs�platformr��insert�anyrdr.r�r_)r
r[r,rZpathext�files�seen�dirZnormdirZthefilerKr )r
r!rUs8







�@)r)FN)r�rrNNN)rrN)r�N)r�r�)r�r�)r�r�)Nr�)NNrrNNN)Nr�)NN)NN�r�r�)r)Vr+rsr7rb�collectionsrE�zlibr��ImportErrorr�r�Zlzmar��pwdrZgrpr�__all__r-r
rrrr"r�r#rr2rrr*rMrrr	rr
rvr�r=rwrx�supports_dir_fdri�supports_fdrTr�rZavoids_symlink_attacksr�rr�r�r�r�r�r�rrrrrr�rrr�r�r�r�r�rrl�
namedtupler�r��__doc__r�r�r�rKr�rr�F_OK�X_OKrr r r r!�<module>s�






:Y!,

58	
@
-





6
"





/




-

Zerion Mini Shell 1.0