Ë
    M/Åe€  ã                   óÔ   — d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl	m
Z
 dedefd	„Zd
edefd„Zddee   dedefd„Zdedee   fd„Zdee   defd„Zdej$                  defd„Zy)z#Internal Certbot display utilities.é    N)ÚList)ÚOptional)Úmessages)ÚmiscÚmsgÚreturnc           	      ó¦   — | j                  «       }g }|D ]*  }|j                  t        j                  |ddd¬«      «       Œ, dj	                  |«      S )zœFormat lines nicely to 80 chars.

    :param str msg: Original message

    :returns: Formatted message respecting newlines in message
    :rtype: str

    éP   F)Úbreak_long_wordsÚbreak_on_hyphensú
)Ú
splitlinesÚappendÚtextwrapÚfillÚjoin)r   ÚlinesÚfixed_lÚlines       ú@/usr/lib/python3/dist-packages/certbot/_internal/display/util.pyÚ
wrap_linesr      sX   € ð �N‰NÓ€EØ€Gàò %ˆØ�‰”x—}‘}ØØØ"Ø"ô	$õ 	%ð%ð �9‰9�WÓÐó    Úlabelc                 ó4   — dj                  | d   | dd ¬«      S )znPlace parens around first character of label.

    :param str label: Must contain at least one character

    z({first}){rest}r   é   N)ÚfirstÚrest)Úformat)r   s    r   Úparens_around_charr   !   s$   € ð ×#Ñ#¨%°©(¸¸q¸r¸Ð#ÓCÐCr   ÚpromptÚtimeoutc                 óÞ   — | r=t         j                  j                  | «       t         j                  j                  «        t	        j
                  || «      }|st        ‚|j                  d«      S )a  Get user input with a timeout.

    Behaves the same as the builtin input, however, an error is raised if
    a user doesn't answer after timeout seconds. The default timeout
    value was chosen to place it just under 12 hours for users following
    our advice and running Certbot twice a day.

    :param str prompt: prompt to provide for input
    :param float timeout: maximum number of seconds to wait for input

    :returns: user response
    :rtype: str

    :raises errors.Error if no answer is given before the timeout

    r   )ÚsysÚstdoutÚwriteÚflushr   Úreadline_with_timeoutÚEOFErrorÚrstrip)r    r!   r   s      r   Úinput_with_timeoutr*   *   sR   € ñ& Ü�
‰
×Ñ˜Ô Ü�
‰
×ÑÔä×%Ñ% g¨vÓ6€DáÜˆØ�;‰;�tÓÐr   Úinput_c                 ó~   — | j                  dd«      }|j                  «       D �cg c]  }t        |«      ‘Œ c}S c c}w )zƒSeparate a comma or space separated list.

    :param str input_: input from the user

    :returns: strings
    :rtype: list

    ú,ú )ÚreplaceÚsplitÚstr)r+   Ú	no_commasÚstrings      r   Úseparate_list_inputr4   H   s5   € ð —‘˜s CÓ(€Ið '0§o¡oÓ&7Ö8˜FŒC��KÒ8Ð8ùÒ8s   ¥:Údomainsc                 óŽ   — | syt        | «      }|dk(  r| d   S |dk(  rdj                  | «      S dj                  | d   |dz
  «      S )aM  Summarizes a list of domains in the format of:
        example.com.com and N more domains
    or if there is are only two domains:
        example.com and www.example.com
    or if there is only one domain:
        example.com

    :param list domains: `str` list of domains
    :returns: the domain list summary
    :rtype: str
    Ú r   r   é   z and z{0} and {1} more domains)Úlenr   r   )r5   Úlengths     r   Úsummarize_domain_listr;   W   sU   € ñ Øä�‹\€FØ�‚{Ø�q‰zÐØ	�1ŠØ�|‰|˜GÓ$Ð$à)×0Ñ0°¸±¸VÀA¹XÓFÐFr   Úerrorc                 óÀ   — | j                   | j                  f}t        |«      rdj                  d„ |D «       «      S | j                  r| j                  S | j
                  S )z½Returns a human-readable description of an RFC7807 error.

    :param error: The ACME error
    :returns: a string describing the error, suitable for human consumption.
    :rtype: str
    z :: c              3   ó&   K  — | ]	  }|€Œ|–— Œ y ­w)N© )Ú.0Úparts     r   ú	<genexpr>z&describe_acme_error.<locals>.<genexpr>x   s   è ø€ ÒF D°TÑ5Eœ4ÑFùs   ‚Š)ÚtitleÚdetailÚanyr   ÚdescriptionÚtyp)r<   Úpartss     r   Údescribe_acme_errorrI   o   sQ   € ð �[‰[˜%Ÿ,™,Ð'€EÜ
ˆ5„zØ�{‰{ÑF¨EÔFÓFÐFØ×ÒØ× Ñ Ð Ø�9‰9Ðr   )Ng     ”á@)Ú__doc__r#   r   Útypingr   r   Úacmer   Úacme_messagesÚcertbot.compatr   r1   r   r   Úfloatr*   r4   r;   ÚErrorrI   r?   r   r   ú<module>rQ      s¬   ðÙ )Û 
Û Ý Ý å *Ý ð�Cð ˜Có ð,D˜cð D có Dñ˜x¨™}ð ¸eð ÐRUó ð<9 ð 9¨¨S©	ó 9ðG 4¨¡9ð G°ó Gð0˜}×2Ñ2ð °sô r   