ok

Mini Shell

Direktori : /opt/alt/python33/lib/python3.3/site-packages/pip/vcs/
Upload File :
Current File : //opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyc

�
�2{Yc@s�dZddlZddlZddlmZmZddlmZddlm	Z	m
Z
mZmZm
Z
ddgZdefd	��YZe�Zd
efd��YZd�ZdS(
s)Handles all VCS (version control) supporti����N(turlparseturllib(tlogger(tdisplay_patht
backup_dirtfind_commandtrmtreetask_path_existstvcstget_src_requirementt
VcsSupportcBs�eZiZddddddgZd�Zd�Zed��Zed	��Zed
��Z	d�Z
ddd�Zd
�Z
d�Zd�ZRS(tsshtgitthgtbzrtsftptsvncCsRtjj|j�ttdd�r;tjj|j�ntt|�j	�dS(Nt
uses_fragment(
Rtuses_netloctextendtschemestgetattrtNoneRtsuperR
t__init__(tself((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyRscCs
|jj�S(N(t	_registryt__iter__(R((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyRscCst|jj��S(N(tlistRtvalues(R((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytbackendsscCsg|jD]}|j^q
S(N(Rtdirname(Rtbackend((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytdirnames"scCs.g}x!|jD]}|j|j�qW|S(N(RRR(RRR ((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytall_schemes&scCsPt|d�s'tjd|j�dS|j|jkrL||j|j<ndS(NtnamesCannot register VCS %s(thasattrRtwarnt__name__R#R(Rtcls((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytregister-s
cCsR||jkr|j|=n2||jj�krA|j|j=n
tjd�dS(Ns0Cannot unregister because no class or name given(RRR#RR%(RR'R#((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyt
unregister4s

cCsOxH|jj�D]7}tjj||j�}tjj|�r|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')
        N(	RRtostpathtjoinRtexistsR#R(Rtlocationtvc_typeR+((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytget_backend_name<s
cCs*|j�}||jkr&|j|SdS(N(tlowerR(RR#((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytget_backendGscCs&|j|�}|r"|j|�SdS(N(R0R2R(RR.R/((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytget_backend_from_locationLs
N(R&t
__module__RRRRtpropertyRR!R"R(RR)R0R2R3(((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyR
s					tVersionControlcBs�eZdZdZdd�Zd�Zd�Zed��Z	d�Z
d�Zd�Zd�Z
d	�Zd
�Zd�Zd�Zd
�Zd�Zed�ZRS(tcOs/||_d|_tt|�j||�dS(N(turlRt_cmdRR6R(RR8targstkwargs((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyRZs		cCs
tj|fS(N(RtINFO(Rtline((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyt_filter_scCs1tjj|�\}}|jtjj�p0|S(s~
           posix absolute paths start with os.path.sep,
           win32 ones ones start with drive (like c:\folder)
        (R*R+t
splitdrivet
startswithtsep(Rtrepotdrivettail((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyt_is_local_repositorybscCsL|jdk	r|jSt|j�}tjd|j|f�||_|S(NsFound command %r at %r(R9RRR#Rtinfo(Rtcommand((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytcmdjs	c	Cs�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((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytget_url_revss"cCsH|jd�j|j�s,td|��|j|�|j|�fS(sA
        Returns (url, revision), where both are strings
        t/sBad directory: %s(trstriptendswithRRKtget_urltget_revision(RR.((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytget_info�s,cCstj|�jd�S(sa
        Normalize a URL for comparison by unquoting it and removing any trailing slash.
        RW(RtunquoteRX(RR8((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyt
normalize_url�scCs|j|�|j|�kS(sV
        Compare two repo URLs for identity, ignoring incidental differences.
        (R^(Rturl1turl2((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytcompare_urls�scCs
t�dS(s�
        Takes the contents of the bundled text file that explains how to revert
        the stripped off version control data of the given package and returns
        the URL and revision of it.
        N(tNotImplementedError(Rtcontent((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytparse_vcs_bundle_file�scCs
t�dS(sx
        Called when installing or updating an editable package, takes the
        source path of the checkout.
        N(Rb(Rtdest((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytobtain�scCs
t�dS(sB
        Switch the repo at ``dest`` to point to ``URL``.
        N(tNotImplemented(RReR8trev_options((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytswitch�scCs
t�dS(sO
        Update an already-existing repo to the given ``rev_options``.
        N(Rb(RReRh((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytupdate�sc
CsLt}t}tjj|�r/t}tjjtjj||j��r|j|�}|j||�r�t	j
d|jj�t
|�|f�t	jdt
|�|j|f�|j||�q,t	jd|j|jt
|�|f�ddf}q/t	jd	||j|jf�d
df}n|rHt	jd|j|f�td|d
|d�}|dkr�t	jd|jt
|�||f�|j|||�qH|dkr�qH|dkr�t	jdt
|��t|�t}qH|dkrHt|�}	t	jdt
|�|	f�tj||	�t}qHn|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%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 %s(RkRlRmRn(RlRmRn(tTruetFalseR*R+R-R,RRZRaRRFt	repo_namettitleRtnotifyRjR%R#RRiRRtshutiltmove(
RReR8Rhtrev_displaytcheckouttprompttexisting_urltresponsetdest_dir((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytcheck_destination�sZ$					
	
		cCs0tjj|�rt|�n|j|�dS(N(R*R+R-RRf(RR.((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pytunpack�s
cCs
t�dS(N(Rb(RtdistR.t	find_tags((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyR	�sN(R&R4R#RRRR>RER5RHRVR\R^RaRdRfRiRjR|R}RpR	(((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyR6Vs"												:	cCsFtj|�}|r+|�j|||�Stjd|�|j�S(Nstcannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch)(RR3R	RR%tas_requirement(R~R.Rtversion_control((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyR	�s
(t__doc__R*Rttpip.backwardcompatRRtpip.logRtpip.utilRRRRRt__all__tobjectR
RR6R	(((sA/opt/alt/python33/lib/python3.3/site-packages/pip/vcs/__init__.pyt<module>s(D	�

Zerion Mini Shell 1.0