HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/pip/_internal/commands/__pycache__/show.cpython-310.pyc
o

@%Ne��@s�ddlZddlmZddlmZmZmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZmZddlmZe�e�ZGd	d
�d
e�ZGdd�de�Zd
eedeefdd�Zdeedededefdd�ZdS)�N)�Values)�Iterator�List�
NamedTuple�Optional��canonicalize_name)�Command)�ERROR�SUCCESS)�BaseDistribution�get_default_environment)�write_outputc@s<eZdZdZdZdZddd�Zded	ee	de
fd
d�ZdS)
�ShowCommandzx
    Show information about one or more installed packages.

    The output is in RFC-compliant mail header format.
    z$
      %prog [options] <package> ...T�returnNcCs,|jjddddddd�|j�d|j�dS)	Nz-fz--files�files�
store_trueFz7Show the full list of installed files for each package.)�dest�action�default�helpr)�cmd_opts�
add_option�parser�insert_option_group)�self�r�=/usr/lib/python3/dist-packages/pip/_internal/commands/show.py�add_optionss�	zShowCommand.add_options�options�argscCs8|s	t�d�tS|}t|�}t||j|jd�stStS)Nz.ERROR: Please provide a package name or names.)�
list_files�verbose)�logger�warningr
�search_packages_info�
print_resultsrr"r)rrr �query�resultsrrr�run&s

�zShowCommand.run)rN)�__name__�
__module__�__qualname__�__doc__�usage�ignore_require_venvrrr�str�intr)rrrrrs
rc@s�eZdZUeed<eed<eed<eeed<eeed<eed<eed<eeed<eed	<eed
<eed<eed<eed
<eeed<eeeed<dS)�_PackageInfo�name�version�location�requires�required_by�	installer�metadata_version�classifiers�summary�homepage�author�author_email�license�entry_pointsrN)r*r+r,r0�__annotations__rrrrrrr24s 
r2r'rc#s��t�}dd�|��D��dd�|D�}t�fdd�t||�D��}|r-t�dd�|��dtd	tt	f�fd
d�}|D]�}z�|}Wn	t
yMYq<wtdd
�|��D�t	jd�}t||�t	jd�}z
|�
d�}	|	jdd�}
Wnty}g}
Ynw|��}|dur�d}nt|�}|j}
t|jt	|j�|jp�d|||j|jp�d|
�dg�|
�dd�|
�dd�|
�dd�|
�dd�|
�dd�|
|d�Vq<dS)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.
    cSsi|]}|j|�qSr)�canonical_name��.0�distrrr�
<dictcomp>O�z(search_packages_info.<locals>.<dictcomp>cSsg|]}t|��qSrr)rDr3rrr�
<listcomp>PrGz(search_packages_info.<locals>.<listcomp>csg|]
\}}|�vr|�qSrr)rDr3�pkg��	installedrrrHRszPackage(s) not found: %s�, �current_distrcs�fdd����D�S)Nc3s6�|]}�jdd�|��D�vr|jdpdVqdS)cSsh|]}t|j��qSr)rr3)rD�drrr�	<setcomp>\szRsearch_packages_info.<locals>._get_requiring_packages.<locals>.<genexpr>.<setcomp>�Name�UNKNOWNN)rB�iter_dependencies�metadatarC�rMrr�	<genexpr>Xs����zHsearch_packages_info.<locals>._get_requiring_packages.<locals>.<genexpr>)�valuesrTrJrTr�_get_requiring_packagesWs
�z5search_packages_info.<locals>._get_requiring_packagescss�|]}|jVqdS)N)r3)rD�reqrrrrUes�z'search_packages_info.<locals>.<genexpr>)�keyzentry_points.txtF)�keependsN��
Classifier�Summaryz	Home-page�AuthorzAuthor-email�License)r3r4r5r6r7r8r9r:r;r<r=r>r?r@r)r
�iter_distributions�sorted�zipr#r$�joinrrr0�KeyErrorrR�lower�	read_text�
splitlines�FileNotFoundError�iter_declared_entriesrSr2�raw_namer4r5r8r9�get_all�get)r'�env�query_names�missingrW�
query_namerEr6r7�entry_points_textr@�
files_iterrrSrrJrr%Fs^���
�






��r%�
distributionsr!r"c	CsHd}t|�D]�\}}d}|dkrtd�td|j�td|j�td|j�td|j�td	|j�td
|j�td|j�td|j	�td
d�
|j��tdd�
|j��|r�td|j
�td|j�td�|jD]}td|�qktd�|jD]	}td|���qz|r�td�|jdur�td�q|jD]	}td|���q�q|S)zC
    Print the information from installed distributions found.
    FTrz---zName: %szVersion: %szSummary: %sz
Home-page: %sz
Author: %szAuthor-email: %szLicense: %szLocation: %szRequires: %srLzRequired-by: %szMetadata-Version: %sz
Installer: %szClassifiers:z  %sz
Entry-points:zFiles:Nz+Cannot locate RECORD or installed-files.txt)�	enumeraterr3r4r;r<r=r>r?r5rcr6r7r9r8r:r@�stripr)	rsr!r"�results_printed�irE�
classifier�entry�linerrrr&�s@




�r&)�logging�optparser�typingrrrr�pip._vendor.packaging.utilsr�pip._internal.cli.base_commandr	�pip._internal.cli.status_codesr
r�pip._internal.metadatarr
�pip._internal.utils.miscr�	getLoggerr*r#rr2r0r%�boolr&rrrr�<module>s*
%C����