Your IP : 3.21.12.41


Current Path : /opt/alt/python34/lib/python3.4/site-packages/pip/commands/__pycache__/
Upload File :
Current File : //opt/alt/python34/lib/python3.4/site-packages/pip/commands/__pycache__/show.cpython-34.pyc

�
�Re�
�@snddlZddlmZddlmZddlmZGdd�de�Zdd�Zd	d
�Z	dS)�N)�Command)�logger)�
pkg_resourcescsFeZdZdZdZdZdZ�fdd�Zdd�Z�S)	�ShowCommandz6Show information about one or more installed packages.�showz$
      %prog [options] <package> ...z*Show information about installed packages.cs^tt|�j||�|jjddddddddd	d
�|jjd|j�dS)Nz-fz--files�dest�files�action�
store_true�defaultF�helpz7Show the full list of installed files for each package.r)�superr�__init__�cmd_opts�
add_option�parser�insert_option_group)�self�args�kw)�	__class__��,/tmp/pip-ztkk0jow-build/pip/commands/show.pyrs		zShowCommand.__init__cCs=|stjd�dS|}t|�}t||j�dS)Nz.ERROR: Please provide a package name or names.)r�warn�search_packages_info�
print_resultsr)r�optionsr�query�resultsrrr�runs
zShowCommand.run)	�__name__�
__module__�__qualname__�__doc__�name�usage�summaryrrrr)rrrsrccs�tdd�tjD��}x�|D]�}|j�}||kr#||}i|jd6|jd6|jd6dd�|j�D�d6}tj	j
|j|j�dd	�}tj	j|�r�||d
<n|Vq#q#WdS)z�
    Gather details from installed distributions. Print distribution name,
    version, location, and installed files. Installed files requires a
    pip generated 'installed-files.txt' in the distributions '.egg-info'
    directory.
    cSs%g|]}|jj�|f�qSr)�project_name�lower)�.0�prrr�
<listcomp>,s	z(search_packages_info.<locals>.<listcomp>r$�version�locationcSsg|]}|j�qSr)r')r)�deprrrr+5s	�requiresz	.egg-infozinstalled-files.txtrN)
�dictr�working_setr(r'r,r-r/�os�path�join�egg_name�isfile)r�installed_packagesr$�normalized_name�dist�package�filelistrrrr$s$




	
	
rcCs�x�|D]�}tjd�tjd|d�tjd|d�tjd|d�tjdd	j|d
��|rtjd�d|kr�x?t|d�D]}tjd
|j��q�Wq�tjd�qqWdS)zD
    Print the informations from installed distributions found.
    z---zName: %sr$zVersion: %sr,zLocation: %sr-zRequires: %sz, r/zFiles:rz  %sz!Cannot locate installed-files.txtN)r�notifyr4�open�strip)�
distributions�list_all_filesr9�linerrrr@s


r)
r2�pip.basecommandr�pip.logr�pip._vendorrrrrrrrr�<module>s

?>