3

Q'ícDã@s`ddlmZddlZddlmZddlmZmZmZddl	m
Z
ddlmZGdd„de
ƒZ
dS)	é)Úabsolute_importN)Ú
WheelCache)ÚInstallRequirementÚRequirementSetÚparse_requirements)ÚCommand)ÚInstallationErrorcs4eZdZdZdZdZdZ‡fdd„Zdd„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] <package> ...
      %prog [options] -r <requirements file> ...zUninstall packages.c	sVtt|ƒj||Ž|jjddddgddd|jjdd	d
ddd
|jjd|jƒdS)Nz-rz
--requirementÚrequirementsÚappendÚfilezjUninstall all the packages listed in the given requirements file.  This option can be used multiple times.)ÚdestÚactionÚdefaultÚmetavarÚhelpz-yz--yesÚyesÚ
store_truez2Don't ask for confirmation of uninstall deletions.)rrrr)Úsuperr	Ú__init__Úcmd_optsÚ
add_optionÚparserÚinsert_option_group)ÚselfÚargsÚkw)Ú	__class__©ú5/tmp/pip-build-l_bcah40/pip/pip/commands/uninstall.pyrszUninstallCommand.__init__c
CsÐ|j|ƒ¼}tjjtƒtƒƒ}t|j|ƒ}tddd|j||d}x$|D]}|j	t
j||j|dƒqFWx2|jD](}x"t
||||dD]}	|j	|	ƒq„WqnW|js´tdt|jdƒ‚|j|jdWdQRXdS)N)Ú	build_dirÚsrc_dirÚdownload_dirÚisolatedÚsessionÚwheel_cache)r$r&)Úoptionsr%r&zLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))Úname)Úauto_confirm)Ú_build_sessionÚpipÚindexÚ
FormatControlÚsetrÚ	cache_dirrÚ
isolated_modeÚadd_requirementrÚ	from_linerrÚhas_requirementsrÚdictr(r
r)
rr'rr%Úformat_controlr&Úrequirement_setr(ÚfilenameÚreqrrr Úrun-s6
zUninstallCommand.run)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r(ÚusageÚsummaryrr9Ú
__classcell__rr)rr r	
s	r	)Ú
__future__rr+Ú	pip.wheelrÚpip.reqrrrÚpip.basecommandrÚpip.exceptionsrr	rrrr Ú<module>s