Файловый менеджер - Редактировать - /usr/lib/python3.9/site-packages/certbot/display/__pycache__/ops.cpython-39.pyc
�азад
a }|�g�4 � @ s� d Z ddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlm Z ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ e�e�Zd@eeed�dd�Zeej e ej d�dd�ZdAee e e ee d�dd�ZdBe e j e e ee d�dd�Z!ee ee d�dd�Z"ee ee d �d!d"�Z#dCee e e e eee f d#�d$d%�Z$dDeee d'�d(d)�Z%ee dd�d*d+�Z&ee dd,�d-d.�Z'edd/�d0d1�Z(ee)eedd2�d3d4�Z*ee ed�d5d6�Z+dEed7e eef f eegef ee e ee eef d8�d9d:�Z,eegef eee eef d;�d<d=�Z-eegef eee eef d;�d>d?�Z.dS )Fz+Contains UI methods for LE user operations.� N)�indent)�Any)�Callable)�Iterable)�List)�Optional)�Tuple)�errors)� interfaces)�util)�account)�osFT)�invalid�optional�returnc C s� d}d}d}|r(| r"||7 }d}q,d}nd}z"t j| r>|| n|dd�\}}W n" tjyp d}t�|��Y n0 |t jkr�|r�t�d��t�d ��t�|�r�|S |r�|| }d}t|�} q,d S )aJ Prompt for valid email address. :param bool invalid: True if an invalid address was provided by the user :param bool optional: True if the user can use --register-unsafely-without-email to avoid providing an e-mail :returns: e-mail address :rtype: str :raises errors.Error: if the user cancels z-There seem to be problems with that address. zCEnter email address (used for urgent renewal and security notices) a If you really want to skip this, you can run the client with --register-unsafely-without-email but you will then be unable to receive notice about impending expiration or revocation of your certificates or problems with your Certbot installation that will lead to failure to renew. FT��force_interactivezoYou should register before running non-interactively, or provide --agree-tos and --email <email_address> flags.zHAn e-mail address or --register-unsafely-without-email must be provided.z#An e-mail address must be provided.N) �display_util� input_textr ZMissingCommandlineFlag�OK�Errorr Z safe_email�bool)r r Zinvalid_prefix�msgZunsafe_suggestionZsuggest_unsafe�codeZemail� r �7/usr/lib/python3.9/site-packages/certbot/display/ops.py� get_email s8 � � r )�accountsr c C s8 dd� | D �}t jd|dd�\}}|t jkr4| | S dS )zChoose an account. :param list accounts: Containing at least one :class:`~certbot._internal.account.Account` c S s g | ] }|j �qS r )Zslug)�.0Zaccr r r � <listcomp>T � z"choose_account.<locals>.<listcomp>zPlease choose an accountTr N)r Zmenur )r �labelsr �indexr r r �choose_accountL s r# )�values�questionr c C s2 t j|r|nd| dd�\}}|t jkr.|r.|S g S )a Display screen to let user pick one or multiple values from the provided list. :param list values: Values to select from :param str question: Question to ask to user while choosing values :returns: List of selected values :rtype: list � T)�tagsr )r � checklistr )r$ r% r �itemsr r r � choose_values\ s � r* )� installerr% r c C sZ | du rt �d� t� S t| �� �}t|�}|s6t� S t||�\}}|tjkrV|rV|S g S )aQ Display screen to select domains to validate. :param installer: An installer object :type installer: :class:`certbot.interfaces.Installer` :param `str` question: Overriding default question to ask the user if asked to choose from domain names. :returns: List of selected names :rtype: `list` of `str` Nz$No installer, picking names manually) �logger�debug�_choose_names_manually�listZ get_all_names�get_valid_domains� _filter_namesr r )r+ r% �domains�namesr r r r �choose_namesm s r4 )r2 r c C s@ g }| D ]2}z|� t�|�� W q tjy8 Y qY q0 q|S )z�Helper method for choose_names that implements basic checks on domain names :param list domains: Domain names to validate :return: List of valid domains :rtype: list )�appendr �enforce_domain_sanityr �ConfigurationError)r2 Z valid_domains�domainr r r r0 � s r0 )�FQDNsr c C s t | dd� d�S )z�Sort FQDNs by SLD (and if many, by their subdomains) :param list FQDNs: list of domain names :returns: Sorted list of domain names :rtype: list c S s | � d�d d d� dd � S )N�.���� )�split)Zfqdnr r r �<lambda>� r z_sort_names.<locals>.<lambda>)�key)�sorted)r9 r r r �_sort_names� s rA )r3 �override_questionr c C s>