ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyc

�
x�_c@s�ddlZddlZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
ddlmZddlmZddlmZddlmZmZerdd	lmZmZmZmZmZd
efd��YZnd�Zd
�Zd�Z e	d��Z!e
dddd�Z"erte"d��Z#ne"ej#�Z#d�Z$d�Z%d�Z&d�Z'd�Z(d�Z)d�Z*dS(i����N(tcontextmanager(tNamedTemporaryFile(tretry(tPY2(tget_path_uid(tformat_size(tMYPY_CHECK_RUNNINGtcast(tAnytBinaryIOtIteratortListtUniontNamedTemporaryFileResultcBseZed��ZRS(cCsdS(N((tself((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytfiles(t__name__t
__module__tpropertyR(((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyR
scCs�tjdksttd�r#tStjj|�s;t�d}x�||kr�tjj	|�r�tj
�dkr�yt|�}Wntk
r�t
SX|dkStj|tj�SqD|tjj|�}}qDWt
S(Ntwin32tgeteuidi(tsystplatformthasattrtostTruetpathtisabstAssertionErrortNonetlexistsRRtOSErrortFalsetaccesstW_OKtdirname(Rtprevioustpath_uid((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytcheck_path_owners

cCs�ytj||�Wnyttfk
r�x\||gD]N}yt|�}Wntk
r`q7X|r7tjdjt����q7q7W�nXdS(s�Wrap shutil.copy2() but map errors copying socket files to
    SpecialFileError as expected.

    See also https://bugs.python.org/issue37700.
    s`{f}` is a socketN(tshutiltcopy2RtIOErrort	is_sockettSpecialFileErrortformattlocals(tsrctdesttftis_socket_file((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytcopy2_fixed;s
cCstjtj|�j�S(N(tstattS_ISSOCKRtlstattst_mode(R((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyR*Tsc
ks�tdtdtjj|�dtjj|�dd|��F}td|�}z	|VWd|jj�tj	|jj
��XWdQXdS(s%Return a file-like object pointing to a tmp file next to path.

    The file is created securely and is ensured to be written to disk
    after the context reaches its end.

    kwargs will be passed to tempfile.NamedTemporaryFile to control
    the way the temporary file will be opened.
    tdeletetdirtprefixtsuffixs.tmpR
N(RR RRR#tbasenameRRtflushtfsynctfileno(RtkwargsR0tresult((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytadjacent_tmp_fileYs		
tstop_max_delayi�t
wait_fixedi�cCsIytj||�Wn.tk
rDtj|�tj||�nXdS(N(RtrenameRtremove(R.R/((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytreplacevs


cCsmx>tjj|�s@tjj|�}||kr7Pn|}qWtjdkrctj|tj�St|�S(sgCheck if a directory is writable.

    Uses os.access() on POSIX, tries creating files on Windows.
    tposix(RRtisdirR#tnameR!R"t_test_writable_dir_win(Rtparent((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyttest_writable_dir�s
csd}d�x�td�D]�}|dj�fd�td�D��}tjj||�}y'tj|tjtjBtjB�}WnVtk
r�}|j	t	j
kr�qn|j	t	jks�|j	t	jkr�t
S�qXtj|�tj|�tSqWtd��dS(Nt(accesstest_deleteme_fishfingers_custard_t$abcdefghijklmnopqrstuvwxyz0123456789i
tc3s|]}tj��VqdS(N(trandomtchoice(t.0t_(talphabet(sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pys	<genexpr>�sis3Unexpected condition testing for writable directory(trangetjoinRRtopentO_RDWRtO_CREATtO_EXCLRterrnotEEXISTtEPERMtEACCESR tclosetunlinkRtEnvironmentError(RR;RSRIRtfdte((RTsO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyRJ�s$)'$

cs\g}xOtj|�D]>\�}}tj||�}|j�fd�|D��qW|S(s�Returns a list of absolute paths of files beneath path, recursively,
    with filenames which match the UNIX-style shell glob pattern.c3s$|]}tjj�|�VqdS(N(RRRV(RRR0(troot(sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pys	<genexpr>�s(Rtwalktfnmatchtfiltertextend(RtpatternR@RStfilestmatches((RdsO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyt
find_files�s
!cCs&tjj|�rdStjj|�S(Ni(RRtislinktgetsize(R((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyt	file_size�scCstt|��S(N(RRo(R((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytformat_file_size�scCscd}xVtj|�D]E\}}}x3|D]+}tjj||�}|t|�7}q,WqW|S(Ng(RReRRVRo(RtsizeRdt_dirsRjtfilenamet	file_path((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytdirectory_size�s
cCstt|��S(N(RRu(R((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pytformat_directory_size�s(+R[RfRtos.pathRPR'R3Rt
contextlibRttempfileRtpip._vendor.retryingRtpip._vendor.sixRtpip._internal.utils.compatRtpip._internal.utils.miscRtpip._internal.utils.typingRRttypingRR	R
RRR
R&R2R*RAt_replace_retryRFRLRJRlRoRpRuRv(((sO/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/utils/filesystem.pyt<module>s@(			
		$				

Zerion Mini Shell 1.0