404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@3.145.88.138: ~ $
3

�PfV0�@s�dZddlmZddlZddlZddlZddlZddlZddlm	Z
ddlmZddl
mZmZmZmZmZddgZeje�ZGd	d
�d
e�Ze�ZGdd�de�Zd
d�ZdS)z)Handles all VCS (version control) support�)�absolute_importN)�parse)�
BadCommand)�display_path�
backup_dir�call_subprocess�rmtree�ask_path_exists�vcs�get_src_requirementcs�eZdZiZddddddgZ�fdd�Zd	d
�Zedd��Zed
d��Z	edd��Z
dd�Zddd�Zdd�Z
dd�Zdd�Z�ZS)�
VcsSupportZsshZgitZhgZbzrZsftpZsvncs:tjj|j�ttdd�r(tjj|j�tt|�j�dS)N�
uses_fragment)	�urllib_parseZuses_netloc�extend�schemes�getattrr
�superr�__init__)�self)�	__class__��/usr/lib/python3.6/__init__.pyrszVcsSupport.__init__cCs
|jj�S)N)�	_registry�__iter__)rrrrr$szVcsSupport.__iter__cCst|jj��S)N)�listr�values)rrrr�backends'szVcsSupport.backendscCsdd�|jD�S)NcSsg|]
}|j�qSr)�dirname)�.0�backendrrr�
<listcomp>-sz'VcsSupport.dirnames.<locals>.<listcomp>)r)rrrr�dirnames+szVcsSupport.dirnamescCs$g}x|jD]}|j|j�qW|S)N)rrr)rrrrrr�all_schemes/szVcsSupport.all_schemescCsFt|d�stjd|j�dS|j|jkrB||j|j<tjd|j�dS)N�namezCannot register VCS %szRegistered VCS backend: %s)�hasattr�logger�warning�__name__r#r�debug)r�clsrrr�register6s
zVcsSupport.registerNcCs<||jkr|j|=n$||jj�kr.|j|j=n
tjd�dS)Nz0Cannot unregister because no class or name given)rrr#r%r&)rr)r#rrr�
unregister>s


zVcsSupport.unregistercCs8x2|jj�D]$}|j|�rtjd||j�|jSqWdS)z�
        Return the name of the version control backend if found at given
        location, e.g. vcs.get_backend_name('/path/to/vcs/checkout')
        zDetermine that %s uses VCS: %sN)rr�controls_locationr%r(r#)r�location�vc_typerrr�get_backend_nameFs


zVcsSupport.get_backend_namecCs |j�}||jkr|j|SdS)N)�lowerr)rr#rrr�get_backendRs
zVcsSupport.get_backendcCs|j|�}|r|j|�SdS)N)r/r1)rr-r.rrr�get_backend_from_locationWs

z$VcsSupport.get_backend_from_location)NN)r'�
__module__�__qualname__rrrr�propertyrr!r"r*r+r/r1r2�
__classcell__rr)rrrs	
rcs�eZdZdZdZfZd+�fdd�	Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd,d'd(�Zed)d*��Z�ZS)-�VersionControl�Ncs||_tt|�j||�dS)N)�urlrr7r)rr9�args�kwargs)rrrrgszVersionControl.__init__cCs"tjj|�\}}|jtjj�p |S)zy
           posix absolute paths start with os.path.sep,
           win32 ones start with drive (like c:\folder)
        )�os�path�
splitdrive�
startswith�sep)rZrepoZdrive�tailrrr�_is_local_repositoryksz#VersionControl._is_local_repositorycCs|jdd�S)N�/�_)�replace)rZsurnamerrr�translate_egg_surnameusz$VersionControl.translate_egg_surnamecCst�dS)z�
        Export the repository at the url to the destination location
        i.e. only download the files, without vcs informations
        N)�NotImplementedError)rr-rrr�exportyszVersionControl.exportc	Cszd}d|jkst||j��|jjdd�d}tj|�\}}}}}d}d|kr^|jdd�\}}tj||||df�}||fS)zm
        Returns the correct repository URL and revision by parsing the given
        repository URL
        zvSorry, '%s' is a malformed VCS url. The format is <vcs>+<protocol>://<url>, e.g. svn+http://myrepo/svn/MyApp#egg=MyApp�+�N�@r8)r9�AssertionError�splitrZurlsplit�rsplitZ
urlunsplit)	rZ
error_messager9�schemeZnetlocr=ZqueryZfragZrevrrr�get_url_rev�szVersionControl.get_url_revcCs4|jd�j|j�s td|��|j|�|j|�fS)zA
        Returns (url, revision), where both are strings
        rCzBad directory: %s)�rstrip�endswithrrL�get_url�get_revision)rr-rrr�get_info�s
zVersionControl.get_infocCstj|�jd�S)zi
        Normalize a URL for comparison by unquoting it and removing any
        trailing slash.
        rC)rZunquoterQ)rr9rrr�
normalize_url�szVersionControl.normalize_urlcCs|j|�|j|�kS)zV
        Compare two repo URLs for identity, ignoring incidental differences.
        )rV)rZurl1Zurl2rrr�compare_urls�szVersionControl.compare_urlscCst�dS)zx
        Called when installing or updating an editable package, takes the
        source path of the checkout.
        N)rG)r�destrrr�obtain�szVersionControl.obtaincCst�dS)zB
        Switch the repo at ``dest`` to point to ``URL``.
        N)rG)rrXr9�rev_optionsrrr�switch�szVersionControl.switchcCst�dS)zO
        Update an already-existing repo to the given ``rev_options``.
        N)rG)rrXrZrrr�update�szVersionControl.updatecCst�dS)zp
        Return True if the version is identical to what exists and
        doesn't need to be updated.
        N)rG)rrXrZrrr�
check_version�szVersionControl.check_versionc
Cs�d}d}tjj|�r�d}tjjtjj||j��r�|j|�}|j||�r�tjd|j	j
�t|�|�|j||�s�tj
dt|�|j	|�|j||�q�tj
d�q�tjd|j|j	t|�|�d}ntjd||j|j	�d}|�r�tjd|j|�td|d|d�}|dk�r2tj
d|j	t|�||�|j|||�n~|d	k�r>nr|d
k�rftjdt|��t|�d}nJ|dk�r�t|�}	tjdt|�|	�tj||	�d}n|dk�r�tjd�|S)z�
        Prepare a location to receive a checkout/clone.

        Return True if the location is ready for (and requires) a
        checkout/clone, False otherwise.
        TFz)%s in %s exists, and has correct URL (%s)zUpdating %s %s%sz$Skipping because already up-to-date.z%s %s in %s exists with URL %s�%(s)witch, (i)gnore, (w)ipe, (b)ackup �s�i�w�bz0Directory %s already exists, and is not a %s %s.�(i)gnore, (w)ipe, (b)ackup z+The plan is to install the %s repository %szWhat to do?  %srrJzSwitching %s %s to %s%szDeleting %szBacking up %s to %s�a�r_r`rarb)r^re�r`rarb)rcrf���)r<r=�exists�joinrrSrWr%r(Z	repo_name�titlerr]�infor\r&r#r	r[rr�shutilZmove�sys�exit)
rrXr9rZZrev_displayZcheckout�promptZexisting_urlZresponseZdest_dirrrr�check_destination�s�







z VersionControl.check_destinationcCs"tjj|�rt|�|j|�dS)zq
        Clean up current location and download the url repository
        (and vcs infos) into location
        N)r<r=rhrrY)rr-rrr�unpackszVersionControl.unpackcCst�dS)z�
        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)rG)r�distr-rrrr sz"VersionControl.get_src_requirementcCst�dS)z_
        Return the url used at location
        Used in get_info or check_destination
        N)rG)rr-rrrrS)szVersionControl.get_urlcCst�dS)z_
        Return the current revision of the files at location
        Used in get_info
        N)rG)rr-rrrrT0szVersionControl.get_revisionT�raisec	Csf|jg|}yt|||||||�Stk
r`}z$|jtjkrNtd|j��n�WYdd}~XnXdS)z�
        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
        zCannot find command %rN)r#r�OSError�errno�ENOENTr)	r�cmdZshow_stdout�cwdZ
on_returncodeZcommand_descZ
extra_environZspinner�errr�run_command7s	zVersionControl.run_commandcCs0tjd||j|j�tjj||j�}tjj|�S)z�
        Check if a location is controlled by the vcs.
        It is meant to be overridden to implement smarter detection
        mechanisms for specific vcs.
        zChecking in %s for %s (%s)...)r%r(rr#r<r=rirh)r)r-r=rrrr,Nsz VersionControl.controls_location)N)TNrsNNN)r'r3r4r#rrrrBrFrHrPrUrVrWrYr[r\r]rprqrrSrTrz�classmethodr,r6rr)rrr7as2
U		
r7cCsZtj|�}|rFy|�j||�Stk
rDtjd||j�|j�SXtjd|�|j�S)NzPcannot determine version of editable source in %s (%s command not found in path)ztcannot determine version of editable source in %s (is not SVN checkout, Git clone, Mercurial clone or Bazaar branch))r
r2rrr%r&r#Zas_requirement)rrr-Zversion_controlrrrr[s

)�__doc__Z
__future__rruZloggingr<rlrmZpip._vendor.six.moves.urllibrrZpip.exceptionsrZ	pip.utilsrrrrr	�__all__Z	getLoggerr'r%�objectrr
r7rrrrr�<module>s 
G{

Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 10.7 KB 0644
__init__.cpython-36.pyc File 10.83 KB 0644
bazaar.cpython-36.opt-1.pyc File 3.55 KB 0644
bazaar.cpython-36.pyc File 3.55 KB 0644
git.cpython-36.opt-1.pyc File 8.69 KB 0644
git.cpython-36.pyc File 8.73 KB 0644
mercurial.cpython-36.opt-1.pyc File 3.47 KB 0644
mercurial.cpython-36.pyc File 3.47 KB 0644
subversion.cpython-36.opt-1.pyc File 6.83 KB 0644
subversion.cpython-36.pyc File 6.92 KB 0644