U
    b                     @   sZ   d Z ddlmZ ddlmZ ee dddZdeed	d
ddZeeed	dddZ	d	S )z 
Handles all display/view logic
    )Sequence   )ChannelNotice)channel_noticesc                 C   sT   d}| D ]F}||j kr@t  d}|d|j  d7 }t| |j }t| t  qdS )z
    Accepts a list of channel notice responses and prints a display.

    Args:
        channel_notices: A sequence of ChannelNotice objects.
    NZChannelz "z" has the following notices:)Zchannel_nameprintprint_notice_message)r   Zcurrent_channelZchannel_noticeZchannel_header r   2lib/python3.8/site-packages/conda/notices/views.pyprint_notices   s    
r
     N)noticeindentreturnc                 C   sF   | j r| j dnd}d| j d| }t| | d| | j  dS )z(
    Prints a single channel notice
    z%c [z] -- 
N)Z
created_atlevelr   message)r   r   Z	timestampr   r   r   r	   r   !   s    r   )total_noticesdisplayed_noticesviewed_noticesr   c                 C   sH   | | | }|dkrD|dkr*d| d}nd| d}t | d dS )	zX
    Conditionally shows a message informing users how many more message there are.
    r   r   z
There are z' more messages. To retrieve them run:

z	There is z$ more message. To retrieve it run:

zconda notices
N)r   )r   r   r   Znotices_not_shownmsgr   r   r	   print_more_notices_message,   s    r   )r   )
__doc__typingr   typesr   r
   strr   intr   r   r   r   r	   <module>   s     