B
    =)H[â
  ã               @   sT   d dl mZ d dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
 G dd„ deƒZdS )	é    )Úabsolute_import)Úcanonicalize_name)ÚCommand)ÚInstallationError)ÚInstallRequirementÚparse_requirementsc                   s4   e Zd ZdZdZdZdZ‡ fdd„Zdd„ 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> ...zUninstall packages.c          	      sV   t t| ƒj||Ž | jjddddg ddd� | jjdd	d
ddd� | j d| j¡ d S )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.)r   r   r   r   )Úsuperr   Ú__init__Úcmd_optsÚ
add_optionÚparserÚinsert_option_group)ÚselfÚargsÚkw)Ú	__class__© úaC:\Users\HIRONO~1\AppData\Local\Temp\pip-install-qz7kpjmn\pip\pip\_internal\commands\uninstall.pyr      s    zUninstallCommand.__init__c       	   	   C   sØ   |   |¡�Ä}i }x0|D ](}tj||jd�}|jr||t|jƒ< qW x:|jD ]0}x*t|||d�D ]}|jr^||t|jƒ< q^W qJW |s–tdt	| jd� ƒ‚x2| 
¡ D ]&}|j|j| jdkd�}|r | ¡  q W W d Q R X d S )N)Úisolated)ÚoptionsÚsessionzLYou must give at least one requirement to %(name)s (see "pip help %(name)s"))Únamer   )Úauto_confirmÚverbose)Ú_build_sessionr   Ú	from_lineÚisolated_moder#   r   r
   r   r   ÚdictÚvaluesr	   r   Ú	verbosityÚcommit)	r   r!   r   r"   Úreqs_to_uninstallr#   ÚreqÚfilenameÚuninstall_pathsetr   r   r   Úrun-   s.    
zUninstallCommand.run)
Ú__name__Ú
__module__Ú__qualname__Ú__doc__r#   ÚusageÚsummaryr   r1   Ú__classcell__r   r   )r   r   r   
   s   	r   N)Ú
__future__r   Úpip._vendor.packaging.utilsr   Úpip._internal.basecommandr   Úpip._internal.exceptionsr   Zpip._internal.reqr   r   r   r   r   r   r   Ú<module>   s
   