3
[                 @   sp   d dl mZ d dlZ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 dd	d
dhZG dd deZdS )    )absolute_importN)
WheelCache)Command)FormatControl)freeze)stdlib_pkgspip
setuptools
distributewheelc                   s8   e Zd ZdZdZdZdZd
Z fddZdd	 Z	  Z
S )FreezeCommandzx
    Output installed packages in requirements format.

    packages are listed in a case-insensitive sorted order.
    r   z
      %prog [options]z1Output installed packages in requirements format.ext://sys.stderrc          	      s   t t| j|| | jjddddg ddd | jjdd	d
dg ddd | jjddddddd | jjdddddd | jjdddddjt d | jjddddd | jjd| j d S ) Nz-rz--requirementrequirementsappendfilez}Use the order in the given requirements file and its comments when generating output. This option can be used multiple times.)destactiondefaultmetavarhelpz-fz--find-links
find_linksURLz<URL for finding packages, which will be added to the output.z-lz--locallocal
store_trueFzUIf in a virtualenv that has global access, do not output globally-installed packages.)r   r   r   r   z--useruserz,Only output packages installed in user-site.z--all
freeze_allz,Do not skip these packages in the output: %sz, )r   r   r   z--exclude-editableexclude_editablez%Exclude editable package from output.r   )	superr   __init__cmd_opts
add_optionjoinDEV_PKGSparserinsert_option_group)selfargskw)	__class__ >/tmp/pip-install-65viz3iy/pip/pip/_internal/commands/freeze.pyr      sN    zFreezeCommand.__init__c             C   s   t t t }t|j|}tt}|js2|jt t|j	|j
|j|j|j|j|||jd	}z(x"tf |D ]}tjj|d  qhW W d |j  X d S )N)	requirementr   
local_only	user_only
skip_regexisolatedwheel_cacheskipr   
)r   setr   	cache_dirr   r   updater"   dictr   r   r   r   skip_requirements_regexisolated_moder   r   sysstdoutwritecleanup)r%   optionsr&   format_controlr0   r1   freeze_kwargsliner)   r)   r*   runI   s&    

zFreezeCommand.run)r   r   )__name__
__module____qualname____doc__nameusagesummarylog_streamsr   rA   __classcell__r)   r)   )r(   r*   r      s   /r   )
__future__r   r9   pip._internal.cacher   Zpip._internal.cli.base_commandr   Z#pip._internal.models.format_controlr   pip._internal.operations.freezer   Zpip._internal.utils.compatr   r"   r   r)   r)   r)   r*   <module>   s   