ó BuÆ_c@@s ddlmZddlZddlZddlZddlZddlZddlZddlm Z ddl m Z ddl m Z mZddlmZmZmZddlmZddlmZmZmZmZmZmZmZmZmZdd lm Z m!Z!dd l"m#Z#e#rydd l$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(R RRtostpathtjoinRtappend(tdistt script_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 ms(RR RHR*tsortedREtanyR+(tpathst short_pathst should_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 }scs@s%|]}tjj|ƒdVqdS(iN(RR R;(RFRP((sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys 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 ˆsc3@s!|]}ˆˆˆ|ƒVqdS(N((RFtd(tdirnameRRRT(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys sc3@s!|]}ˆˆˆ|ƒVqdS(N((RFtf(RVRRRT(sP/opt/alt/python36/lib/python3.6/site-packages/pip/_internal/req/req_uninstall.pys ’s(tdictR*RItvaluesRERJRtwalktupdatetdifference_updateR+RHtmapt __getitem__( RKtcase_mapt remainingt uncheckedt wildcardst all_filest all_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 Ës ( R*R:R+RR RVR]RORNRZR!tisfile( RKt will_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(sStashes 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|Ñ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_scriptst gui_scripts(4RR9R RŽRRAtsystprefixt sysconfigtget_pathR tformatRt to_filenameR¨tegg_infoRR R tgetattrt _providerR~R:R+t has_metadatat get_metadatat splitlinestnormpathR!RR;RVR¦R@topenROtreadlinetstriptAssertionErrorRtmetadata_isdirtmetadata_listdirR RRRt 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”Rt classmethodRä(((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ƒ|dnss s iÿÿÿÿsutf-8sRemoving entry: %stwb(RŽRRæ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ÑRRÈ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½t pip._vendorRtpip._internal.exceptionsRtpip._internal.locationsRRtpip._internal.utils.compatRRRtpip._internal.utils.loggingRtpip._internal.utils.miscR R R R 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.pyts8      @ @    ( 3oÿ