
    wBf                     t    d Z ddlZddlmZ ddlmZ ddlmZ dee   fd	Zdd
ede	ddfdZ
dedededdfdZy)zHandles all display/view logic.    N)Sequence   )context   )ChannelNoticechannel_noticesc                 n   d}t         j                  r=t        j                  | D cg c]  }|j                          c}      }t	        |       y| D ]\  }||j
                  k7  r6t	                d}|d|j
                   dz  }t	        |       |j
                  }t        |       t	                ^ yc c}w )z
    Accepts a list of channel notice responses and prints a display.

    Args:
        channel_notices: A sequence of ChannelNotice objects.
    NChannelz "z" has the following notices:)r   jsondumpsto_dictprintchannel_nameprint_notice_message)r   current_channelchannel_noticejson_outputchannel_headers        3lib/python3.12/site-packages/conda/notices/views.pyprint_noticesr      s     O||jj<KL.^##%L
 	k . 
	N."="==!*4455QR n%"0"="= 0G
	 Ms   B2noticeindentreturnc                     | j                   r| j                   dnd}d| j                   d| }t        | | d| | j                          y)zPrints a single channel notice.z%c [z] -- 
N)
created_atlevelr   message)r   r   	timestampr   s       r   r   r   )   sR    -3->->6$$R(BI~U9+.E	VHUG2fXfnn%5
67    total_noticesdisplayed_noticesviewed_noticesc                 `    | |z
  |z
  }|dkD  r!|dkD  rd| d}nd| d}t        | d       yy)	zNConditionally 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%   notices_not_shownmsgs        r   print_more_notices_messager)   2   s[     &69JJ1q 011Z[C/00VWC_%& r"   )z  )__doc__r   typingr   base.contextr   typesr   r   strr   intr)    r"   r   <module>r1      sf    &   "  8M#: :8 8 8t 8''+.'@C'	'r"   