3 ÝPfD ã@s`ddlmZddlZddlmZddlmZmZmZddl m Z ddl m 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] ... %prog [options] -r ...zUninstall packages.c sVtt|ƒj||Ž|jjddddgddd�|jjdd d d d 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__Zcmd_optsZ add_optionÚparserZinsert_option_group)ÚselfÚargsÚkw)Ú __class__©ú/usr/lib/python3.6/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)Z build_dirZsrc_dirZ download_dirÚisolatedÚsessionÚ wheel_cache)rr )Úoptionsrr zLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))Úname)Z auto_confirm)Z_build_sessionÚpipÚindexZ FormatControlÚsetrÚ cache_dirrZ isolated_modeZadd_requirementrZ from_liner rZhas_requirementsrÚdictr"r r) rr!rrZformat_controlr Zrequirement_setr"ÚfilenameZreqrrrÚrun-s6     zUninstallCommand.run) Ú__name__Ú __module__Ú __qualname__Ú__doc__r"ZusageZsummaryrr)Ú __classcell__rr)rrr s   r )Z __future__rr#Z pip.wheelrZpip.reqrrrZpip.basecommandrZpip.exceptionsrr rrrrÚs