o
    VhL	                     @  sl   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 er,d dl	m
Z
 d dlmZ G dd	 d	eZd
S )    )annotations)TYPE_CHECKING)ClassVar)argument)Command)Argument)Rowsc                   @  sD   e Zd ZU dZdZedddddgZded< dddZdddZ	dS )SourceShowCommandzsource showz:Show information about sources configured for the project.sourcezCSource(s) to show information for. Defaults to showing all sources.T)optionalmultiplezClassVar[list[Argument]]	argumentsreturnNonec                 C  s*   | j jds	d S | d | d d S )Npypiz<c1><b>PyPI</> is implicitly enabled as a <b>primary</> source. If you wish to disable it, or alter its priority please refer to <b>https://python-poetry.org/docs/repositories/#package-sources</>.</> )poetrypoolhas_repositoryline)self r   w/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/poetry/console/commands/source/show.pynotify_implicit_pypi   s   z&SourceShowCommand.notify_implicit_pypiintc                   s0  | j  }| d}dd |D  |s| d |   dS |r:t fdd|D s:| jdd	| d
d dS d}|D ]O}|rJ|j	  vrJq>|j	 dkrSd}| j
dd}dd|j dgg}|jrq|dd|j g |dd|jj	  g || |  | d q>|s|r|   dS )Nr
   c                 S  s   g | ]}|  qS r   )lower).0namer   r   r   
<listcomp>+   s    z,SourceShowCommand.handle.<locals>.<listcomp>z(No sources configured for this project.
r   c                 3  s    | ]
}|j   v V  qd S )N)r   r   )r   slower_namesr   r   	<genexpr>2   s    z+SourceShowCommand.handle.<locals>.<genexpr>zNo source found with name(s): z, error)style   Tr   Fcompactz<info>name</>z : <c1>z</>z<info>url</>z : z<info>priority</>r   )r   get_sourcesr   r   r   any
line_errorjoinr   r   tableurlappendpriorityadd_rowsrender)r   sourcesnamesis_pypi_implicitr
   r+   rowsr   r    r   handle(   s<   



zSourceShowCommand.handleN)r   r   )r   r   )
__name__
__module____qualname__r   descriptionr   r   __annotations__r   r5   r   r   r   r   r	      s   
 
	r	   N)
__future__r   typingr   r   cleo.helpersr   poetry.console.commands.commandr   cleo.io.inputs.argumentr   cleo.ui.tabler   r	   r   r   r   r   <module>   s    