ok

Mini Shell

Direktori : /lib/python3.6/site-packages/certbot/display/__pycache__/
Upload File :
Current File : //lib/python3.6/site-packages/certbot/display/__pycache__/util.cpython-36.pyc

3

گa�&�
@s,dZddlZddlmZddlmZddlmZddlmZddlmZddlm	Z	dd	lm
Z
ddlZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlmZddlmZe
jZe
jZdZdZdZedd�dd�Zd1eeeeedd�dd�Zd2ee
eeee	eeffeeeeee	eefd�dd�Z d3eeeeeee	eefd�d d!�Z!d4eeeeeeeeed$�d%d&�Z"d5eeeeeeeeee	eeefd'�d(d)�Z#d6eeeeeee	eefd�d*d+�Z$eeeedd,�d-d.�Z%Gd/d0�d0�Z&eee&ej'e(��ej'e(<dS)7a$Certbot display.

This module (`certbot.display.util`) or its companion `certbot.display.ops`
should be used whenever:

- Displaying status information to the user on the terminal
- Collecting information from the user via prompts

Other messages can use the `logging` module. See `log.py`.

�N)�
ModuleType)�Any)�cast)�List)�Optional)�Tuple)�Union)�obj)�FileDisplay)�NoninteractiveDisplay)�
SIDE_FRAME)�input_with_timeout)�separate_list_input)�summarize_domain_list�H�help�esc)�msg�returncCstj�j|dddd�dS)zMDisplay a basic status message.

    :param str msg: message to display

    F)�pause�decorate�wrapN)r	�get_display�notification)r�r�/usr/lib/python3.6/util.py�notify4srTF)�messagerr�force_interactiverrcCstj�j|||||d�dS)a�Displays a notification and waits for user acceptance.

    :param str message: Message to display
    :param bool pause: Whether or not the program should pause for the
        user's confirmation
    :param bool wrap: Whether or not the application should wrap text
    :param bool force_interactive: True if it's safe to prompt the user
        because it won't cause any workflow regressions
    :param bool decorate: Whether to surround the message with a
        decorated frame

    )rrrrN)r	rr)rrrrrrrrr=sr)r�choices�default�cli_flagrrcCstj�j|||||d�S)aDisplay a menu.

    .. todo:: This doesn't enable the help label/button (I wasn't sold on
        any interface I came up with for this). It would be a nice feature.

    :param str message: title of menu
    :param choices: Menu lines, len must be > 0
    :type choices: list of tuples (tag, item) or
        list of descriptions (tags will be enumerated)
    :param default: default value to return, if interaction is not possible
    :param str cli_flag: option used to set this value with the CLI
    :param bool force_interactive: True if it's safe to prompt the user
        because it won't cause any workflow regressions

    :returns: tuple of (`code`, `index`) where
        `code` - str display exit code
        `index` - int index of the user's selection

    :rtype: tuple

    )r r!r)r	r�menu)rrr r!rrrrr"Osr")rr r!rrcCstj�j||||d�S)a�Accept input from the user.

    :param str message: message to display to the user
    :param default: default value to return, if interaction is not possible
    :param str cli_flag: option used to set this value with the CLI
    :param bool force_interactive: True if it's safe to prompt the user
        because it won't cause any workflow regressions

    :returns: tuple of (`code`, `input`) where
        `code` - str display exit code
        `input` - str of the user's input
    :rtype: tuple

    )r r!r)r	r�input)rr r!rrrr�
input_textksr$�Yes�No)r�	yes_label�no_labelr r!rrcCstj�j||||||d�S)a~Query the user with a yes/no question.

    Yes and No label must begin with different letters, and must contain at
    least one letter each.

    :param str message: question for the user
    :param str yes_label: Label of the "Yes" parameter
    :param str no_label: Label of the "No" parameter
    :param default: default value to return, if interaction is not possible
    :param str cli_flag: option used to set this value with the CLI
    :param bool force_interactive: True if it's safe to prompt the user
        because it won't cause any workflow regressions

    :returns: True for "Yes", False for "No"
    :rtype: bool

    )r'r(r r!r)r	r�yesno)rr'r(r r!rrrrr)sr))r�tagsr r!rrcCstj�j|||||d�S)a'Display a checklist.

    :param str message: Message to display to user
    :param list tags: `str` tags to select, len(tags) > 0
    :param default: default value to return, if interaction is not possible
    :param str cli_flag: option used to set this value with the CLI
    :param bool force_interactive: True if it's safe to prompt the user
        because it won't cause any workflow regressions

    :returns: tuple of (`code`, `tags`) where
        `code` - str display exit code
        `tags` - list of selected tags
    :rtype: tuple

    )r r!r)r	r�	checklist)rr*r r!rrrrr+�sr+cCstj�j||||d�S)a�Display a directory selection screen.

    :param str message: prompt to give the user
    :param default: default value to return, if interaction is not possible
    :param str cli_flag: option used to set this value with the CLI
    :param bool force_interactive: True if it's safe to prompt the user
        because it won't cause any workflow regressions

    :returns: tuple of the form (`code`, `string`) where
        `code` - display exit code
        `string` - input entered by the user

    )r r!r)r	r�directory_select)rr r!rrrrr,�sr,)�promptr r!rrcCs4dj|�}|r|dj|�7}|dk	s0|s0t|��dS)a0Verify that provided arguments is a valid display call.

    :param str prompt: prompt for the user
    :param default: default answer to prompt
    :param str cli_flag: command line option for setting an answer
        to this question
    :param bool force_interactive: if interactivity is forced

    z)Invalid display call for this prompt:
{0}z7
You can set an answer to this prompt with the {0} flagN)�format�AssertionError)r-r r!rrrrr�assert_valid_call�s


r0c@sdeZdZdZedd�dd�Zeed�dd�Zeedd	�d
d�Z	edd�dd
�Z
eed�dd�ZdS)�_DisplayUtilDeprecationModulez�
    Internal class delegating to a module, and displaying warnings when attributes
    related to deprecated attributes in the certbot.display.util module.
    N)�modulercCs||jd<dS)N�_module)�__dict__)�selfr2rrr�__init__�sz&_DisplayUtilDeprecationModule.__init__)�attrrc
Cs*|d
krtjd
j|�tdd�t|j|�S)Nr
rrr
rr�WIDTH�HELP�ESCzT{0} attribute in certbot.display.util module is deprecated and will be removed soon.�)�
stacklevel)	r
rrr
rrr8r9r:)�warnings�warnr.�DeprecationWarning�getattrr3)r5r7rrr�__getattr__�s
z)_DisplayUtilDeprecationModule.__getattr__)r7�valuercCst|j||�dS)N)�setattrr3)r5r7rBrrr�__setattr__�sz)_DisplayUtilDeprecationModule.__setattr__cCst|j|�dS)N)�delattrr3)r5r7rrr�__delattr__�sz)_DisplayUtilDeprecationModule.__delattr__)rcCsdgt|j�S)Nr3)�dirr3)r5rrr�__dir__�sz%_DisplayUtilDeprecationModule.__dir__)
�__name__�
__module__�__qualname__�__doc__rr6�strrrArDrFrrHrrrrr1�sr1)TTFT)NNF)NNF)r%r&NNF)NNF)NNF))rL�sys�typesrZtypingrrrrrrr=Zcertbot._internal.displayr	Zcertbot._internal.display.objr
rrZcertbot._internal.display.utilr
rrZOKZCANCELr8r9r:rMr�boolr�intr"r$r)r+r,r0r1�modulesrIrrrr�<module>sN	B($6(

Zerion Mini Shell 1.0