3
PfD @ s` d dl mZ d dlZd dlmZ d dlmZmZmZ d dl m
Z
d dlmZ G dd de
Z
dS ) )absolute_importN)
WheelCache)InstallRequirementRequirementSetparse_requirements)Command)InstallationErrorc s4 e Zd ZdZdZdZdZ fddZdd Z Z S ) UninstallCommandaB
Uninstall packages.
pip is able to uninstall most installed packages. Known exceptions are:
- Pure distutils packages installed with ``python setup.py install``, which
leave behind no metadata to determine what files were installed.
- Script wrappers installed by ``python setup.py develop``.
uninstallzU
%prog [options] ...
%prog [options] -r ...zUninstall packages.c sV t t| j|| | jjddddg ddd | jjdd d
ddd
| jjd| j d S )Nz-rz
--requirementrequirementsappendfilezjUninstall all the packages listed in the given requirements file. This option can be used multiple times.)destactiondefaultmetavarhelpz-yz--yesyes
store_truez2Don't ask for confirmation of uninstall deletions.)r r r r )superr __init__Zcmd_optsZ
add_optionparserZinsert_option_group)selfargskw) __class__ /usr/lib/python3.6/uninstall.pyr s zUninstallCommand.__init__c
C s | j |}tjjt t }t|j|}td d d |j||d}x$|D ]}|j t
j||j|d qFW x2|jD ](}x"t
||||dD ]} |j | qW qnW |jstdt| jd |j|jd W d Q R X d S )N)Z build_dirZsrc_dirZdownload_dirisolatedsessionwheel_cache)r r )optionsr r zLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))name)Zauto_confirm)Z_build_sessionpipindexZ
FormatControlsetr cache_dirr Z
isolated_modeZadd_requirementr Z from_liner r Zhas_requirementsr dictr" r
r )
r r! r r Zformat_controlr Zrequirement_setr" filenameZreqr r r run- s6
zUninstallCommand.run)
__name__
__module____qualname____doc__r" ZusageZsummaryr r)
__classcell__r r )r r r
s r )Z
__future__r r# Z pip.wheelr Zpip.reqr r r Zpip.basecommandr Zpip.exceptionsr r r r r r s