ok

Mini Shell

Direktori : /lib/python3.6/site-packages/pip/vcs/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/pip/vcs/__pycache__/bazaar.cpython-36.pyc

3

�Pf��@s�ddlmZddlZddlZddlZyddlmZWnek
rPddl	ZYnXddl
mZmZddl
mZmZddlmZeje�ZGdd�de�Zeje�dS)	�)�absolute_importN)�parse)�rmtree�display_path)�vcs�VersionControl)�path_to_urlcszeZdZdZdZdZdZd �fdd�	Zd
d�Zdd�Z	dd�Z
dd�Z�fdd�Zdd�Z
dd�Zdd�Zdd�Z�ZS)!�Bazaar�bzrz.bzr�branch�bzr+http�	bzr+https�bzr+ssh�bzr+sftp�bzr+ftp�bzr+lpNcsDtt|�j|f|�|�ttdd�r@tjjdg�tjjdg�dS)N�
uses_fragmentZlp)�superr	�__init__�getattr�urllib_parser�extendZnon_hierarchical)�self�url�args�kwargs)�	__class__��/usr/lib/python3.6/bazaar.pyrszBazaar.__init__cCsRtjdd�}|j|�tjj|�r*t|�z|jd|g|dd�Wdt|�XdS)zU
        Export the Bazaar repository at the url to the destination location
        z-exportzpip-�exportF)�cwd�show_stdoutN)�tempfileZmkdtemp�unpack�os�path�existsr�run_command)r�locationZtemp_dirrrrr&s
z
Bazaar.exportcCs|jd|g|d�dS)N�switch)r )r')r�destr�rev_optionsrrrr)5sz
Bazaar.switchcCs|jddg||d�dS)NZpullz-q)r )r')rr*r+rrr�update8sz
Bazaar.updatecCsl|j�\}}|r"d|g}d|}ng}d}|j||||�rhtjd||t|��|jddg|||g�dS)Nz-rz (to revision %s)�zChecking out %s%s to %srz-q)�get_url_revZcheck_destination�logger�inforr')rr*r�revr+Zrev_displayrrr�obtain;s

z
Bazaar.obtaincs,tt|�j�\}}|jd�r$d|}||fS)Nzssh://zbzr+)rr	r.�
startswith)rrr1)rrrr.Ls
zBazaar.get_url_revcCsl|jdgd|d�}xT|j�D]H}|j�}x:dD]2}|j|�r.|j|�d}|j|�r\t|�S|Sq.WqWdS)Nr0F)r!r �checkout of branch: �parent branch: �)r4r5)r'�
splitlines�stripr3�splitZ_is_local_repositoryr)rr(Zurls�line�x�reporrr�get_urlSs

zBazaar.get_urlcCs|jdgd|d�}|j�dS)NZrevnoF)r!r r6���)r'r7)rr(Zrevisionrrr�get_revision`szBazaar.get_revisioncCsT|j|�}|sdS|j�jd�s(d|}|j�jdd�d}|j|�}d|||fS)Nzbzr:zbzr+�-r6rz%s@%s#egg=%s)r=�lowerr3Zegg_namer9r?)rZdistr(r<Zegg_project_nameZcurrent_revrrr�get_src_requirementes

zBazaar.get_src_requirementcCsdS)z&Always assume the versions don't matchFr)rr*r+rrr�
check_versionoszBazaar.check_version)r
rr
rrrr)N)�__name__�
__module__�__qualname__�name�dirnameZ	repo_nameZschemesrrr)r,r2r.r=r?rBrC�
__classcell__rr)rrr	s

r	)Z
__future__rZloggingr$r"Zurllibrr�ImportErrorZurlparseZ	pip.utilsrrZpip.vcsrrZpip.downloadrZ	getLoggerrDr/r	�registerrrrr�<module>s
_

Zerion Mini Shell 1.0