/
proc
/
self
/
root
/
lib
/
python3
/
dist-packages
/
certbot
/
_internal
/
display
/
__pycache__
/
Upload File
HOME
� E��c� � �� � d Z ddlZddlZddlmZ ddlmZ ddlmZ ddl m Z dedefd �Zd edefd�Z dd ee dedefd�Zdedee fd�Zdee defd�Zdej defd�ZdS )z#Internal Certbot display utilities.� N)�List)�Optional)�messages)�misc�msg�returnc � � | � � � }g }|D ]-}|� t j |ddd�� � � � �.d� |� � 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 su � � �N�N���E��G�� %� %�����x�}���"�"� $� $� $� %� %� %� %� �9�9�W���� �labelc �L � d� | d | dd� �� � 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�r��#�C�C�Cr � ��@�prompt�timeoutc �� � | r=t j � | � � t j � � � t j || � � }|st �|� 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"