
}_D                 @   s   d  d l  m Z d  d l Z d  d l m Z d  d l m Z m Z m Z d  d l	 m
 Z
 d  d l m Z Gd d   d e
  Z d S)	    )absolute_importN)
WheelCache)InstallRequirementRequirementSetparse_requirements)Command)InstallationErrorc                   sF   e  Z d  Z d Z d Z d Z d Z   f d d   Z d d   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                s   t  t |   j | |   |  j j d d d d d d d g  d d	 d
 d |  j j d d d d d d d
 d |  j j d |  j  d  S)Nz-rz--requirementdestrequirementsactionappenddefaultmetavarfilehelpzjUninstall all the packages listed in the given requirements file.  This option can be used multiple times.z-yz--yesyes
store_truez2Don't ask for confirmation of uninstall deletions.r   )superr	   __init__cmd_opts
add_optionparserinsert_option_group)selfargskw)	__class__ 5/tmp/pip-build-3_sjtvrs/pip/pip/commands/uninstall.pyr      s    				zUninstallCommand.__init__c       
      C   s2  |  j  |  } t j j t   t    } t | j |  } t d d  d d  d d  d | j d | d |  } x3 | D]+ } | j	 t
 j | d | j d |  qv WxG | j D]< } x3 t | d | d | d | D] }	 | j	 |	  q Wq W| j st d t d	 |  j    | j d
 | j  Wd  QRXd  S)N	build_dirsrc_dirdownload_dirisolatedsessionwheel_cacheoptionszLYou 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_liner   r   has_requirementsr   dictr(   r
   r   )
r   r'   r   r%   format_controlr&   requirement_setr(   filenamereqr   r   r    run-   s6    			zUninstallCommand.run)	__name__
__module____qualname____doc__r(   usagesummaryr   r9   r   r   )r   r    r	   
   s   	r	   )
__future__r   r+   	pip.wheelr   pip.reqr   r   r   pip.basecommandr   pip.exceptionsr   r	   r   r   r   r    <module>   s   