ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyc

�
Bu�_c@@s
ddlmZddlZddlZddlZddlZddlZddlZddlm	Z	ddl
mZddlm
Z
mZddlmZmZmZddlmZddlmZmZmZmZmZmZmZmZmZdd	lm Z m!Z!dd
l"m#Z#e#ryddl$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/nej0e1�Z2d
�Z3d�Z4e4d��Z5d�Z6d�Z7d�Z8de9fd��YZ:de9fd��YZ;de9fd��YZ<dS(i(tabsolute_importN(t
pkg_resources(tUninstallationError(tbin_pytbin_user(tWINDOWStcache_from_sourcetuses_pycache(t
indent_log(	tFakeFiletasktdist_in_usersitet
dist_is_localt
egg_link_pathtis_localtnormalize_pathtrenamestrmtree(tAdjacentTempDirectoryt
TempDirectory(tMYPY_CHECK_RUNNING(	tAnytCallabletDicttIterabletIteratortListtOptionaltSettTuple(tDistributioncC@s�t|�rt}nt}tjj||�}|g}tr�|j|d�|j|d�|r{|j|d�q�|j|d�n|S(s�Create the fully qualified name of the files created by
    {console,gui}_scripts for the given ``dist``.
    Returns the list of file names
    s.exes
.exe.manifests-script.pyws
-script.py(RRRtostpathtjoinRtappend(tdisttscript_nametis_guitbin_dirtexe_nametpaths_to_remove((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt
_script_names's		c@s"tj���fd��}|S(Nc?@sHt�}x8�||�D]'}||kr|j|�|VqqWdS(N(tsettadd(targstkwtseentitem(tfn(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytunique?s
	
(t	functoolstwraps(R0R1((R0sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt_unique=scc@s�tjt|jd���}x�|D]�}tjj|j|d�}|V|jd�r%tjj	|�\}}|d }tjj||d�}|Vtjj||d�}|Vq%q%WdS(s
    Yield all the uninstallation paths for dist based on RECORD-without-.py[co]

    Yield paths to all the files in RECORD. For each .py file in RECORD, add
    the .pyc and .pyo in the same directory.

    UninstallPathSet.add() takes care of the __pycache__ .py[co].
    tRECORDis.pyi����s.pycs.pyoN(
tcsvtreaderR	tget_metadata_linesRR R!tlocationtendswithtsplit(R#trtrowR tdnR0tbase((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytuninstallation_pathsJs

c@sktjj�t�}xOt|dt�D];�t��fd�|D��}|s(|j��q(q(W|S(s�Compact a path set to contain the minimal number of paths
    necessary to contain all paths in the set. If /a/path/ and
    /a/path/to/a/file.txt are both in the set, leave only the
    shorter path.tkeyc3@sO|]E}�j|jd��oF�t|jd�j����kVqdS(t*N(t
startswithtrstriptlen(t.0t	shortpath(R tsep(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>ms(RR RHR*tsortedREtanyR+(tpathstshort_pathstshould_skip((R RHsP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytcompactbs	
c	@sRtd�|D��}t|�}ttd�|j�D��dt�}t�}d��x�|D]��t�fd�|D��r�qcnt�}t�}xftj��D]U\�}}|j���fd�|D��|j���fd�|D��q�W||sc|j	|�|j
�tj�qcqcWtt|j
|��|BS(s�Returns a set containing the paths that need to be renamed.

    This set may include directories when the original sequence of paths
    included every file on disk.
    cs@s'|]}tjj|�|fVqdS(N(RR tnormcase(RFtp((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>}scs@s%|]}tjj|�dVqdS(iN(RR R;(RFRP((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>sRAcW@stjjtjj|��S(N(RR ROR!(ta((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt	norm_join�sc3@s*|] }tjj��j|�VqdS(N(RR RORC(RFtw(troot(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>�sc3@s!|]}���|�VqdS(N((RFtd(tdirnameRRRT(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>�sc3@s!|]}���|�VqdS(N((RFtf(RVRRRT(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>�s(tdictR*RItvaluesRERJRtwalktupdatetdifference_updateR+RHtmapt__getitem__(	RKtcase_mapt	remainingt	uncheckedt	wildcardst	all_filestall_subdirstsubdirstfiles((RVRRRTsP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytcompress_for_renamevs*		

		

c
C@st|�}t�}t�}t�}xg|D]_}|jd�rIq.n|jd�sdd|kr�|jtjj|��n|j|�q.Wtttjj|��}t|�}x�|D]�}x�tj	|�D]�\}}	}
xr|
D]j}|jd�rq�ntjj
||�}tjj|�r�tjj|�|kr�|j|�q�q�Wq�Wq�W|d�|D�B}||fS(ssReturns a tuple of 2 sets of which paths to display to user

    The first set contains paths that would be deleted. Files of a package
    are not added and the top-level directory of the package has a '*' added
    at the end - to signify that all it's contents are removed.

    The second set contains files that would have been skipped in the above
    folders.
    s.pycs__init__.pys
.dist-infocS@s%h|]}tjj|d��qS(RB(RR R!(RFtfolder((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<setcomp>�s	(R*R:R+RR RVR]RORNRZR!tisfile(
RKtwill_removet	will_skiptfoldersRfR t_normcased_filesRhtdirpatht_tdirfilestfnametfile_((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytcompress_for_output_listing�s0			


tStashedUninstallPathSetcB@sSeZdZd�Zd�Zd�Zd�Zd�Zd�Ze	d��Z
RS(sWA set of file rename operations to stash files while
    tentatively uninstalling them.cC@si|_g|_dS(N(t
_save_dirst_moves(tself((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt__init__�s	cC@sSyt|�}Wn tk
r2tdd�}nX||jtjj|�<|jS(s�Stashes a directory.

        Directories are stashed adjacent to their original location if
        possible, or else moved/copied into the user's temp dir.tkindt	uninstall(RtOSErrorRRuRR RO(RwR tsave_dir((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt_get_directory_stash�s
cC@s�tjj|�}tjj|�d}}d}x}||kr�y|j|}PWntk
renXtjj|�|}}q4Wtjj|�}tdd�}||j|<tjj||�}|r�|tjj	kr�tjj
|j|�S|jS(s�Stashes a file.

        If no root has been provided, one will be created for the directory
        in the user's temp directory.RyRzN(RR RORVtNoneRutKeyErrorRtrelpathtcurdirR!(RwR theadtold_headR|R�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt_get_file_stash�s"


cC@s�tjj|�o"tjj|�}|r=|j|�}n|j|�}|jj||f�|r�tjj|�r�tj|�nt	||�|S(s�Stashes the directory or file and returns its new location.
        Handle symlinks as files to avoid modifying the symlink targets.
        (
RR tisdirtislinkR}R�RvR"trmdirR(RwR tpath_is_dirtnew_path((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytstashs%
cC@s@x'|jj�D]\}}|j�qWg|_i|_dS(s0Commits the uninstall by removing stashed files.N(RutitemstcleanupRv(RwRoR|((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytcommits	cC@s�x!|jD]}tjd|�q
Wx�|jD]�\}}ywtjd||�tjj|�sttjj|�r�tj|�ntjj	|�r�t
|�nt||�Wq.tk
r�}tj
d|�tjd|�q.Xq.W|j�dS(s2Undoes the uninstall by moving stashed files back.sMoving to %s
 from %ssReplacing %s from %ssFailed to restore %ss
Exception: %sN(RvtloggertinfotdebugRR RiR�tunlinkR�RRR{terrorR�(RwRPR�R tex((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytrollback&s$
cC@s
t|j�S(N(tboolRv(Rw((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytcan_rollback:s(t__name__t
__module__t__doc__RxR}R�R�R�R�tpropertyR�(((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyRt�s							tUninstallPathSetcB@skeZdZd�Zd�Zd�Zd�Zeed�Zd�Z	d�Z
d�Zed	��Z
RS(
sMA set of file paths to be removed in the uninstallation of a
    requirement.cC@s:t�|_t�|_i|_||_t�|_dS(N(R*RKt_refusetpthR#Rtt_moved_paths(RwR#((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyRxCs
		cC@s
t|�S(ss
        Return True if the given path is one we are permitted to
        remove/modify, False otherwise.

        (R(RwR ((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt
_permittedKscC@s�tjj|�\}}tjjt|�tjj|��}tjj|�sUdS|j|�rw|jj	|�n|j
j	|�tjj|�ddkr�tr�|j	t
|��ndS(Nis.py(RR R;R!RROtexistsR�RKR+R�tsplitextRR(RwR R�ttail((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR+Ts'"cC@skt|�}|j|�rW||jkr@t|�|j|<n|j|j|�n|jj|�dS(N(RR�R�tUninstallPthEntriesR+R�(Rwtpth_filetentry((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pytadd_pthhsc	C@s�|js#tjd|jj�dS|jjd|jj}tjd|�t���|sl|j|�r�|j}t	|j�}x7t
t|��D]#}|j|�tj
d|�q�Wx!|jj�D]}|j�q�Wtjd|�nWdQXdS(s[Remove paths in ``self.paths`` with confirmation (unless
        ``auto_confirm`` is True).s7Can't uninstall '%s'. No files were found to uninstall.Nt-sUninstalling %s:sRemoving file or directory %ssSuccessfully uninstalled %s(RKR�R�R#tproject_nametversionRt_allowed_to_proceedR�RgRIRNR�R�R�RYtremove(Rwtauto_confirmtverbosetdist_name_versiontmovedt
for_renameR R�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR�rs"	

	
cC@s�d�}|s't|j�\}}nt|j�}t�}|d|�|d|�|d|j�|r�|dt|j��ntdd	�dkS(
sIDisplay which files would be deleted and prompt for confirmation
        cS@sU|s
dStj|�t��/x'tt|��D]}tj|�q4WWdQXdS(N(R�R�RRIRN(tmsgRKR ((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt_display�s

s
Would remove:s+Would not remove (might be manually added):s%Would not remove (outside of prefix):sWill actually move:sProceed (y/n)? tytn(R�R�(RsRKR*R�RgR
(RwR�R�RjRk((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR��s	
	

cC@sq|jjs&tjd|jj�dStjd|jj�|jj�x!|jj	�D]}|j�qYWdS(s1Rollback the changes previously made by remove().s'Can't roll back %s; was not uninstalledNsRolling back uninstall of %s(
R�R�R�R�R#R�R�R�R�RY(RwR�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR��s

cC@s|jj�dS(s?Remove temporary save dir: rollback will no longer be possible.N(R�R�(Rw((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR��scC@sOt|j�}t|�sAtjd|j|tj�||�S|d�tj	d�tj	d�hD�kr�tjd|j|�||�S||�}t
|�}djtj
|j��}|jo�tjj|j�}t|jdd�}|rl|jjd�rl|jj|�rl|j|j�|jd	�r�x'|jd	�j�D]7}tjjtjj|j|��}	|j|	�qUWq|jd
�r|jd�r�|jd�}
ng}
x�g|jd
�j�D]}|r�||
kr�|^q�D]^}tjj|j|�}	|j|	�|j|	d�|j|	d
�|j|	d�qWqn�|r�tdj|j���n{|jjd�r|j|j�tjj|j�d}
tjjtjj|j�d�}|j |d|
�n|rB|jjd�rBx�t!|�D]}	|j|	�q(Wn�|r�t"|d��%}tjj#|j$�j%��}WdQX||jks�t&dj||j|j���|j|�tjjtjj|�d�}|j ||j�ntj'd||j�|jd�r�|j(d�r�xz|j)d�D]f}t*|�rQt+}nt,}|jtjj||��t-r6|jtjj||�d�q6q6Wng}|j.dd�}x-|j/�D]}|j0t1||t2��q�W|j.dd�}x-|j/�D]}|j0t1||t3��q
Wx|D]}|j|�q4W|S(Ns1Not uninstalling %s at %s, outside environment %scS@sh|]}|r|�qS(((RFRP((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<setcomp>�s	tstdlibt
platstdlibs<Not uninstalling %s at %s, as it is in the standard library.s{}.egg-infoR s	.egg-infosinstalled-files.txts
top_level.txtsnamespace_packages.txts.pys.pycs.pyos�Cannot uninstall {!r}. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.s.eggiseasy-install.pths./s
.dist-infoR<s;Egg-link {} does not match installed location of {} (at {})s)Not sure how to uninstall: %s - Check: %stscriptss.battgrouptconsole_scriptstgui_scripts(4RR9RR�R�RAtsystprefixt	sysconfigtget_pathR
tformatRtto_filenameR�tegg_infoRR R�tgetattrt	_providerR~R:R+thas_metadatatget_metadatat
splitlinestnormpathR!RR;RVR�R@topenROtreadlinetstriptAssertionErrorR�tmetadata_isdirtmetadata_listdirRRRRt
get_entry_maptkeystextendR)tFalsetTrue(tclsR#t	dist_pathR(tdevelop_egg_linktdevelop_egg_link_egg_infotegg_info_existstdistutils_egg_infotinstalled_fileR t
namespacesRPt
top_level_pkgteasy_install_eggteasy_install_pthtfhtlink_pointertscriptR&t_scripts_to_removeR�tnameR�ts((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt	from_dist�s�


		"
	$
	
	*
(R�R�R�RxR�R+R�R�R�R�R�R�tclassmethodR�(((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR�@s					
 			R�cB@s,eZd�Zd�Zd�Zd�ZRS(cC@s"||_t�|_d|_dS(N(tfileR*tentriesR~t_saved_lines(RwR�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyRxJs	cC@sXtjj|�}trDtjj|�drD|jdd�}n|jj|�dS(Nis\t/(RR RORt
splitdrivetreplaceR�R+(RwR�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR+Ps
cC@sWtjd|j�tjj|j�s?tjd|j�dSt|jd��}|j�}||_	WdQXt
d�|D��r�d}nd}|r�|dj|jd��r�|d|jd�|d<nxS|j
D]H}y.tjd	|�|j||jd��Wq�tk
r&q�Xq�Wt|jd
��}|j|�WdQXdS(NsRemoving pth entries from %s:s.Cannot remove entries from nonexistent file %strbcs@s|]}d|kVqdS(s
N((RFtline((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys	<genexpr>nss
s
i����sutf-8sRemoving entry: %stwb(R�R�R�RR RitwarningR�t	readlinesR�RJR:tencodeR�R�t
ValueErrort
writelines(RwR�tlinestendlineR�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR�`s*
	#
cC@sh|jdkr&tjd|j�tStjd|j�t|jd��}|j|j�WdQXt	S(Ns.Cannot roll back changes to %s, none were mades!Rolling %s back to previous stateR�(
R�R~R�R�R�R�R�R�R�R�(RwR�((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR�~s
(R�R�RxR+R�R�(((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyR�Is			(=t
__future__RR6R2tloggingRR�R�tpip._vendorRtpip._internal.exceptionsRtpip._internal.locationsRRtpip._internal.utils.compatRRRtpip._internal.utils.loggingRtpip._internal.utils.miscR	R
RRR
RRRRtpip._internal.utils.temp_dirRRtpip._internal.utils.typingRttypingRRRRRRRRRtpip._vendor.pkg_resourcesRt	getLoggerR�R�R)R4R@RNRgRstobjectRtR�R�(((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pyt<module>s8@@		
		(	3o�

Zerion Mini Shell 1.0