File: //usr/lib/python3/dist-packages/certbot/display/__pycache__/util.cpython-38.pyc
U
�](U � @ s� d Z ddlZddlZddlZddlZddlmZ ddlmZ ddlm Z ddl
mZ ddl
mZ ddl
mZ e�e�Zd Zd
ZdZdZd
ZdZdd� Zddd�Zej�e j�G dd� de��Zdd� Zej�e j�G dd� de��Z dd� Z!dd� Z"dS )zCertbot display.� N)� constants)�errors)�
interfaces)�misc)�os)� completer�H �okZcancel�helpZesczO- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -c C s8 | � � }g }|D ]}|�tj|dddd�� qd�|�S )z�Format lines nicely to 80 chars.
:param str msg: Original message
:returns: Formatted message respecting newlines in message
:rtype: str
�P F)Zbreak_long_wordsZbreak_on_hyphens�
)�
splitlines�append�textwrapZfill�join)�msg�linesZfixed_l�line� r �6/usr/lib/python3/dist-packages/certbot/display/util.py�_wrap_lines% s �
r � ��@c C s8 | rt j�| � t j�� t�|| �}|s.t�|�d�S )a Get user input with a timeout.
Behaves the same as six.moves.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 Zreadline_with_timeout�EOFError�rstrip)�promptZtimeoutr r r r �input_with_timeout; s
r c s� e Zd ZdZ� fdd�Zddd�Zd d d
�Zd!dd�Zd"dd�Zd#dd�Z dd� Z
dd� Zd$dd�Zdd� Z
dd� Zdd� Z� ZS )%�FileDisplayzFile-based display.c s$ t t| ��� || _|| _d| _d S )NF)�superr �__init__�outfile�force_interactive�skipped_interaction)�selfr# r$ �� __class__r r r"