HEX
Server: LiteSpeed
System: Linux cluster02.load-balancer.x2.network 4.18.0-553.51.1.lve.1.el8.x86_64 #1 SMP Wed May 14 14:34:57 UTC 2025 x86_64
User: kbdhpghp (1098)
PHP: 8.2.29
Disabled: NONE
Upload Files
File: //lib/python3.6/site-packages/certbot/_internal/display/__pycache__/util.cpython-36.pyc
3

گa}�@s�dZddlZddlZddlmZddlmZddlmZeed�dd�Z	eed	�d
d�Z
deeeed
�dd�Zeeed�dd�Z
eeed�dd�ZdS)z#Internal Certbot display utilities.�N)�List)�Optional)�misc)�msg�returncCs<|j�}g}x$|D]}|jtj|dddd��qWdj|�S)z�Format lines nicely to 80 chars.

    :param str msg: Original message

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

    �PF)Zbreak_long_wordsZbreak_on_hyphens�
)�
splitlines�append�textwrapZfill�join)r�linesZfixed_l�line�r�/usr/lib/python3.6/util.py�
wrap_lines
s	
r)�labelrcCsdj|d|dd�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)rrrr�parens_around_char sr���@)�prompt�timeoutrcCs8|rtjj|�tjj�tj||�}|s.t�|jd�S)aGet 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�flushrZreadline_with_timeout�EOFError�rstrip)rrrrrr�input_with_timeout)s
r!)�input_rcCs|jdd�}dd�|j�D�S)z�Separate a comma or space separated list.

    :param str input_: input from the user

    :returns: strings
    :rtype: list

    �,� cSsg|]}t|��qSr)�str)�.0�stringrrr�
<listcomp>Ssz'separate_list_input.<locals>.<listcomp>)�replace�split)r"Z	no_commasrrr�separate_list_inputGs	r+)�domainsrcCsJ|sdSt|�}|dkr |dS|dkr2dj|�Sdj|d|d�SdS)aMSummarizes 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
    �rr�z and z{0} and {1} more domainsN)�lenrr)r,Zlengthrrr�summarize_domain_listVs
r0)Nr)�__doc__rrZtypingrrZcertbot.compatrr%rr�floatr!r+r0rrrr�<module>s