AlkantarClanX12

Your IP : 3.145.72.44


Current Path : /lib/python2.7/site-packages/pip/vcs/
Upload File :
Current File : //lib/python2.7/site-packages/pip/vcs/__init__.pyc

�
��abc@@s�dZddlmZddlZddlZddlZddlZddlZddlm	Z
ddlmZddl
mZmZmZmZmZddgZeje�Zd	efd
��YZe�Zdefd��YZd
�ZdS(s)Handles all VCS (version control) supporti(tabsolute_importN(tparse(t
BadCommand(tdisplay_patht
backup_dirtcall_subprocesstrmtreetask_path_existstvcstget_src_requirementt
VcsSupportcB@s�eZiZddddddgZd�Zd�Zed��Zed	��Zed
��Z	d�Z
ddd�Zd
�Z
d�Zd�ZRS(tsshtgitthgtbzrtsftptsvncC@sRtjj|j�ttdd�r;tjj|j�ntt|�j	�dS(Nt
uses_fragment(
turllib_parsetuses_netloctextendtschemestgetattrtNoneRtsuperR
t__init__(tself((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyRscC@s
|jj�S(N(t	_registryt__iter__(R((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR$scC@st|jj��S(N(tlistRtvalues(R((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytbackends'scC@sg|jD]}|j^q
S(N(Rtdirname(Rtbackend((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytdirnames+scC@s.g}x!|jD]}|j|j�qW|S(N(RRR(RRR!((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytall_schemes/scC@sbt|d�s&tjd|j�dS|j|jkr^||j|j<tjd|j�ndS(NtnamesCannot register VCS %ssRegistered VCS backend: %s(thasattrtloggertwarningt__name__R$Rtdebug(Rtcls((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytregister6scC@sR||jkr|j|=n2||jj�krA|j|j=n
tjd�dS(Ns0Cannot unregister because no class or name given(RRR$R&R'(RR*R$((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyt
unregister>s

cC@sJxC|jj�D]2}|j|�rtjd||j�|jSqWdS(s�
        Return the name of the version control backend if found at given
        location, e.g. vcs.get_backend_name('/path/to/vcs/checkout')
        sDetermine that %s uses VCS: %sN(RRtcontrols_locationR&R)R$R(Rtlocationtvc_type((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytget_backend_nameFs	
cC@s*|j�}||jkr&|j|SdS(N(tlowerR(RR$((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytget_backendRscC@s&|j|�}|r"|j|�SdS(N(R0R2R(RR.R/((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytget_backend_from_locationWs
N(R(t
__module__RRRRtpropertyRR"R#R+RR,R0R2R3(((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR
s						tVersionControlcB@s�eZdZdZdZdd�Zd�Zd�Zd�Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zedddddd�Zed��ZRS(tcO@s&||_tt|�j||�dS(N(turlRR6R(RR8targstkwargs((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyRgs	cC@s1tjj|�\}}|jtjj�p0|S(sy
           posix absolute paths start with os.path.sep,
           win32 ones start with drive (like c:\folder)
        (tostpatht
splitdrivet
startswithtsep(Rtrepotdrivettail((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyt_is_local_repositorykscC@s|jdd�S(Nt/t_(treplace(Rtsurname((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyttranslate_egg_surnameuscC@s
t�dS(s�
        Export the repository at the url to the destination location
        i.e. only download the files, without vcs informations
        N(tNotImplementedError(RR.((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytexportysc	C@s�d}d|jks(t||j��|jjdd�d}tj|�\}}}}}d}d|kr�|jdd�\}}ntj||||df�}||fS(sm
        Returns the correct repository URL and revision by parsing the given
        repository URL
        svSorry, '%s' is a malformed VCS url. The format is <vcs>+<protocol>://<url>, e.g. svn+http://myrepo/svn/MyApp#egg=MyAppt+it@R7N(R8tAssertionErrortsplitRturlsplitRtrsplitt
urlunsplit(	Rt
error_messageR8tschemetnetlocR<tquerytfragtrev((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytget_url_rev�s"cC@sH|jd�j|j�s,td|��|j|�|j|�fS(sA
        Returns (url, revision), where both are strings
        RDsBad directory: %s(trstriptendswithR RMtget_urltget_revision(RR.((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytget_info�s
cC@stj|�jd�S(si
        Normalize a URL for comparison by unquoting it and removing any
        trailing slash.
        RD(RtunquoteRY(RR8((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyt
normalize_url�scC@s|j|�|j|�kS(sV
        Compare two repo URLs for identity, ignoring incidental differences.
        (R_(Rturl1turl2((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytcompare_urls�scC@s
t�dS(sx
        Called when installing or updating an editable package, takes the
        source path of the checkout.
        N(RI(Rtdest((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytobtain�scC@s
t�dS(sB
        Switch the repo at ``dest`` to point to ``URL``.
        N(RI(RRcR8trev_options((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytswitch�scC@s
t�dS(sO
        Update an already-existing repo to the given ``rev_options``.
        N(RI(RRcRe((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytupdate�scC@s
t�dS(sp
        Return True if the version is identical to what exists and
        doesn't need to be updated.
        N(RI(RRcRe((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyt
check_version�sc
C@smt}t}tjj|�rAt}tjjtjj||j��r|j|�}|j||�r�t	j
d|jj�t
|�|�|j||�s�t	jdt
|�|j|�|j||�qt	jd�q>t	jd|j|jt
|�|�ddf}qAt	jd
||j|j�ddf}n|rit	jd|j|�td
|d|d�}|dkr�t	jd|jt
|�||�|j|||�qi|dkr�qi|dkrt	jdt
|��t|�t}qi|d	krJt|�}	t	jdt
|�|	�tj||	�t}qi|dkritjd�qin|S(s�
        Prepare a location to receive a checkout/clone.

        Return True if the location is ready for (and requires) a
        checkout/clone, False otherwise.
        s)%s in %s exists, and has correct URL (%s)sUpdating %s %s%ss$Skipping because already up-to-date.s%s %s in %s exists with URL %ss%(s)witch, (i)gnore, (w)ipe, (b)ackup tstitwtbs0Directory %s already exists, and is not a %s %s.s(i)gnore, (w)ipe, (b)ackup s+The plan is to install the %s repository %ssWhat to do?  %siisSwitching %s %s to %s%ssDeleting %ssBacking up %s to %stai����(RiRjRkRl(RjRkRl(tTruetFalseR;R<texiststjoinR R[RbR&R)t	repo_namettitleRRhtinfoRgR'R$RRfRRtshutiltmovetsystexit(
RRcR8Retrev_displaytcheckouttprompttexisting_urltresponsetdest_dir((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytcheck_destination�s�$		
	

	
		cC@s0tjj|�rt|�n|j|�dS(sq
        Clean up current location and download the url repository
        (and vcs infos) into location
        N(R;R<RpRRd(RR.((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytunpacks
cC@s
t�dS(s�
        Return a string representing the requirement needed to
        redownload the files currently present in location, something
        like:
          {repository_url}@{revision}#egg={project_name}-{version_identifier}
        N(RI(RtdistR.((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR	 scC@s
t�dS(s_
        Return the url used at location
        Used in get_info or check_destination
        N(RI(RR.((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR[)scC@s
t�dS(s_
        Return the current revision of the files at location
        Used in get_info
        N(RI(RR.((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR\0straisec	C@su|jg|}y t|||||||�SWn>tk
rp}|jtjkrjtd|j��qq�nXdS(s�
        Run a VCS subcommand
        This is simply a wrapper around call_subprocess that adds the VCS
        command name, and checks that the VCS is available
        sCannot find command %rN(R$RtOSErrorterrnotENOENTR(	Rtcmdtshow_stdouttcwdt
on_returncodetcommand_desct
extra_environtspinnerte((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pytrun_command7s	cC@sDtjd||j|j�tjj||j�}tjj|�S(s�
        Check if a location is controlled by the vcs.
        It is meant to be overridden to implement smarter detection
        mechanisms for specific vcs.
        sChecking in %s for %s (%s)...(R&R)R R$R;R<RqRp(R*R.R<((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR-Ns	(N(R(R4R$R RRRRCRHRJRXR]R_RbRdRfRgRhRR�R	R[R\RnR�tclassmethodR-(((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR6as2	
											U						cC@sztj|�}|r`y|�j||�SWq`tk
r\tjd||j�|j�SXntjd|�|j�S(NsPcannot determine version of editable source in %s (%s command not found in path)stcannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch)(RR3R	RR&R'R$tas_requirement(R�R.tversion_control((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyR	[s

(t__doc__t
__future__RR�tloggingR;RuRwtpip._vendor.six.moves.urllibRRtpip.exceptionsRt	pip.utilsRRRRRt__all__t	getLoggerR(R&tobjectR
RR6R	(((s4/usr/lib/python2.7/site-packages/pip/vcs/__init__.pyt<module>s(G	�