ok

Mini Shell

Direktori : /opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/
Upload File :
Current File : //opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyo

�
x�_c@sdZddlZddlZddlZddlZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZddlmZddlmZdd	lmZdd
lmZmZmZmZddlmZddl m!Z!dd
l"m#Z#ddl$m%Z%e!rtddl&m'Z'm(Z(m)Z)m*Z*ddl+m,Z,ddlm-Z-ddl.m/Z/ddl0m1Z1ddl2m3Z3ddl4m5Z5ddl6m7Z7ddlm8Z8ere,die'e9e(e9ge(e9fd6e:d6de;�Z<qte,die'e9e9gdfd6e'e9e(e9ge(e9fd6e:d6e:d6de;�Z<nej>e?�Z@d�ZAd�ZBd eCfd!��YZDddd"�ZEd#�ZFd$�ZGddd%�ZHddd&�ZId'�ZJd(�ZKd)eCfd*��YZLdS(+s)Prepares a distribution for installation
i����N(tPY2(t)make_distribution_for_install_requirement(tInstalledDistribution(tDirectoryUrlHashUnsupportedtHashMismatchtHashUnpinnedtInstallationErrortNetworkConnectionErrortPreviousBuildDirErrortVcsHashUnsupported(tcopy2_fixed(t
MissingHashes(t
indent_log(tdisplay_paththide_urltpath_to_displaytrmtree(t
TempDirectory(tMYPY_CHECK_RUNNING(tunpack_file(tvcs(tCallabletListtOptionaltTuple(t	TypedDict(tAbstractDistribution(t
PackageFinder(tLink(t
Downloader(tInstallRequirement(tRequirementTracker(tHashestCopytreeKwargstignoretsymlinksttotalt
copy_functiontignore_dangling_symlinkscCs6t|�}|j|��|j||�WdQX|S(s-Prepare a distribution for installation.
    N(Rttracktprepare_distribution_metadata(treqtreq_trackertfindertbuild_isolationt
abstract_dist((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_get_prepared_distributionPs	cCs2tj|j�}|j|dt|j��dS(Nturl(Rtget_backend_for_schemetschemetunpackRR/(tlinktlocationtvcs_backend((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pytunpack_vcs_link_stFilecBseZd�ZRS(cCs||_||_dS(N(tpathtcontent_type(tselfR8R9((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt__init__gs	(t__name__t
__module__R;(((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyR7fscCs�tdddt�}d}|r6t|||�}n|rX|}tj|�d}nt|||j|�\}}t||�S(NtkindR2tglobally_managedi(	RtTruetNonet_check_download_dirt	mimetypest
guess_typet_download_http_urlR8R7(R3t
downloadertdownload_dirthashesttemp_dirtalready_downloaded_patht	from_pathR9((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pytget_http_urlmscCsVyt||�Wn>tjk
rQ}tjdt|�t|�t|��nXdS(s�Copying special files is not supported, but as a convenience to users
    we skip errors copying them. This supports tools that may create e.g.
    socket files in the project source directory.
    s>Ignoring special file error '%s' encountered copying %s to %s.N(R
tshutiltSpecialFileErrortloggertwarningtstrR(tsrctdestte((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_copy2_ignoring_special_files�s		cs�tjj|�}tjj|��tjj|�����fd�}td|dt�}tsst|d<nt	j
�||�dS(NcsQg}|�kr%|ddg7}ntjj|��krM|�g7}n|S(Ns.toxs.nox(tosR8tabspath(tdtnamestskipped(tsourcettarget_basenamettarget_dirname(sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyR"�sR"R#R%(RVR8RWtbasenametdirnametdictR@RRURMtcopytree(R[ttargetttarget_abspathR"tkwargs((R[R\R]sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_copy_source_tree�s
cCsod}|r!t|||�}n|r0|}n	|j}|rO|j|�ntj|�d}t||�S(s,Get file and optionally check its hash.
    iN(RARBt	file_pathtcheck_against_pathRCRDR7(R3RGRHRJRKR9((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pytget_file_url�s			cCs�|jrt||�dS|j�rYtjj|�rEt|�nt|j	|�dS|j
rzt||d|�}nt|||d|�}|j
s�t|j||j�n|S(s_Unpack link into location, downloading if required.

    :param hashes: A Hashes object, one of whose embedded hashes must match,
        or HashMismatch will be raised. If the Hashes is empty, no matches are
        required, and unhashable types of requirements (like VCS ones, which
        would ordinarily raise HashUnsupported) are allowed.
    RHN(tis_vcsR6RAtis_existing_dirRVR8tisdirRReRftis_fileRhRLtis_wheelRR9(R3R4RFRGRHtfile((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt
unpack_url�s$	

			cCs�||�}tjj||j�}t|d��(}x|jD]}|j|�q@WWdQX|rs|j|�n||jj	j
dd�fS(s6Download link url into temp_dir using provided sessiontwbNscontent-typet(RVR8tjointfilenametopentchunkstwriteRgtresponsetheaderstget(R3RFRIRHtdownloadRftcontent_filetchunk((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyREscCs�tjj||j�}tjj|�s.dStjd|�|r�y|j|�Wq�t	k
r�tj
d|�tj|�dSXn|S(s� Check download_dir for previously downloaded file with correct hash
        If a correct file is found return its path else None
    sFile was already downloaded %ss;Previously-downloaded file %s has bad hash. Re-downloading.N(RVR8RrRstexistsRAROtinfoRgRRPtunlink(R3RGRHt
download_path((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyRB#s

tRequirementPreparercBs_eZdZd�Zed��Zd�Zd�Zd�Ze	d�Z
d�Zd�ZRS(	sPrepares a Requirement
    cCsqtt|�j�||_||_||_||_||_||_||_	||_
|	|_|
|_dS(N(
tsuperR�R;tsrc_dirt	build_dirR*RFR+RGtwheel_download_dirR,trequire_hashest
use_user_site(R:R�RGR�R�R,R*RFR+R�R�((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyR;As									cCsO|js
tStjj|j�r&tStjd�tdj	|j���dS(Ns!Could not find download directorys0Could not find or access download directory '{}'(
RGtFalseRVR8R}R@ROtcriticalRtformat(R:((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_download_should_savens	
cCsN|jjr1|jj}tjdt|��ntjd|jpF|�dS(sLog the way the link prepared.s
Processing %ss
Collecting %sN(R3RlRfROR~R
R)(R:R)R8((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_log_preparing_link|scCsr|jjrdS|j|jdtd|�tjjtjj|j	d��rnt
dj||j	���ndS(s1Ensure source_dir of a linked InstallRequirement.Nt
autodeletetparallel_buildsssetup.pys�pip can't proceed with requirements '{}' due to apre-existing build directory ({}). This is likely due to a previous installation that failed . pip is being responsible and not assuming it can delete this. Please delete it and try again.(R3Rmtensure_has_source_dirR�R@RVR8R}Rrt
source_dirRR�(R:R)RGR�((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_ensure_link_req_src_dir�s	$cCs�|js|jdt�S|jjr1t��n|jj�rLt��n|jdkrq|j
rqt��n|jdt�p�t
�S(Nttrust_internet(R�RHR@R3RiR	RjRt
original_linkRAt	is_pinnedRR�R(R:R)((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt_get_linked_req_hashes�s	c

Cs�|j}|j|�|jr4|jr4|j}n	|j}t��\|j|||�y.t||j|j	|d|j
|��}Wn.tk
r�}tdj
|||���nX|r�|j|_nt||j|j|j�}|rv|j�rtjd�qv|rvtjj||j�}tjj|�sstj|j|�t|�}	tjd|	�qsqvn|jr�|jr�|j |j�q�nWdQX|S(s3Prepare a requirement to be obtained from req.link.RHsDCould not install requirement {} because of HTTP error {} for URL {}s*Link is a directory, ignoring download_dirsSaved %sN(!R3R�RmR�RGRR�RoR�RFR�RRR�R8tlocal_file_pathR.R*R+R,RjROR~RVRrRsR}RMtcopyR
R�Ritarchive(
R:R)R�R3RGt
local_filetexcR-tdownload_locationR�((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pytprepare_linked_requirement�sB	
	
			c	Cs�tjd|�t���|jr;tdj|���n|j|j�|j|j	�t
||j|j|j
�}|j	r�|j|j�n|j|j�WdQX|S(s(Prepare an editable requirement
        sObtaining %ssoThe editable requirement {} cannot be installed when requiring hashes, because there is no single file to hash.N(ROR~RR�RR�R�R�tupdate_editableR�R.R*R+R,R�RGtcheck_if_existsR�(R:R)R-((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pytprepare_editable_requirement�s	
		cCsUtjd|||jj�t��*|jr?tjd�nt|�}WdQX|S(s1Prepare an already-installed requirement
        sRequirement %s: %s (%s)s�Since it is already installed, we are trusting this package without checking its hash. To ensure a completely repeatable environment, install into an empty virtualenv.N(ROR~tsatisfied_bytversionRR�tdebugR(R:R)tskip_reasonR-((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pytprepare_installed_requirements

	
(
R<R=t__doc__R;tpropertyR�R�R�R�R�R�R�R�(((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyR�=s	-				!4	(MR�tloggingRCRVRMtpip._vendor.sixRtpip._internal.distributionsRt%pip._internal.distributions.installedRtpip._internal.exceptionsRRRRRRR	tpip._internal.utils.filesystemR
tpip._internal.utils.hashesRtpip._internal.utils.loggingRtpip._internal.utils.miscR
RRRtpip._internal.utils.temp_dirRtpip._internal.utils.typingRtpip._internal.utils.unpackingRtpip._internal.vcsRttypingRRRRtmypy_extensionsRRt"pip._internal.index.package_finderRtpip._internal.models.linkRtpip._internal.network.downloadRtpip._internal.req.req_installRtpip._internal.req.req_trackerRR RQtboolR�R!RAt	getLoggerR<ROR.R6tobjectR7RLRUReRhRoRERBR�(((sQ/opt/alt/python27/lib/python2.7/site-packages/pip/_internal/operations/prepare.pyt<module>sp4	""

		
		""+		

Zerion Mini Shell 1.0