Ë
    M/Åed  ã                   ó"  — d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ej                  Z	 ej                  Z		 dZ
ded	d
fd„Z	 	 ddededededed	d
fd„Z	 	 d dedeee   eeeef      f   dee   dee   ded	eeef   fd„Z	 	 d dedee   dee   ded	eeef   f
d„Z	 	 	 d!dedededee   dee   ded	efd„Z	 	 	 d dedee   deee      dee   ded	eeee   f   fd„Z	 	 d dedee   dee   ded	eeef   f
d„Zdedededed	d
f
d„Zy
)"a$  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`.

é    )ÚList)ÚOptional)ÚTuple)ÚUnion)ÚobjéH   ÚmsgÚreturnNc                 óR   — t        j                  «       j                  | ddd¬«       y)zMDisplay a basic status message.

    :param str msg: message to display

    F)ÚpauseÚdecorateÚwrapN©r   Úget_displayÚnotification)r	   s    ú6/usr/lib/python3/dist-packages/certbot/display/util.pyÚnotifyr      s"   € ô ‡O�OÓ×"Ñ" 3¨e¸eÈ%Ð"ÕPó    Úmessager   r   Úforce_interactiver   c                 óT   — t        j                  «       j                  | ||||¬«       y)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

    )r   r   r   r   Nr   )r   r   r   r   r   s        r   r   r   &   s+   € ô ‡O�OÓ×"Ñ" 7°%¸dØ5FÐQYð #õ [r   ÚchoicesÚdefaultÚcli_flagc                 óR   — t        j                  «       j                  | ||||¬«      S )a  Display 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)r   r   r   r   r   s        r   r   r   8   s0   € ô0 �?‰?Ó×!Ñ! '¨7¸GÈhØ4Eð "ó Gð Gr   c                 óP   — t        j                  «       j                  | |||¬«      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   Úinput©r   r   r   r   s       r   Ú
input_textr!   T   s.   € ô  �?‰?Ó×"Ñ" 7°GÀhØ5Fð #ó Hð Hr   Ú	yes_labelÚno_labelc                 óT   — t        j                  «       j                  | |||||¬«      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)r   r"   r#   r   r   r   s         r   r%   r%   h   s4   € ô( �?‰?Ó×"Ñ" 7°iÈ(Ð\cØ,4ÐHYð #ó [ð [r   Útagsc                 óR   — t        j                  «       j                  | ||||¬«      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   Ú	checklist)r   r&   r   r   r   s        r   r(   r(   €   s1   € ô$ �?‰?Ó×&Ñ& w°¸gÐPXØ9Jð 'ó Lð Lr   c                 óP   — t        j                  «       j                  | |||¬«      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   Údirectory_selectr    s       r   r*   r*   –   s/   € ô �?‰?Ó×-Ñ-¨g¸wÐQYØ@Qð .ó Sð Sr   Úpromptc                 ój   — dj                  | «      }|r|dj                  |«      z  }|€
|sJ |«       ‚yy)a0  Verify 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)r+   r   r   r   r	   s        r   Úassert_valid_callr.   ©   sK   € ð 7×
=Ñ
=¸fÓ
E€CÙØð 0ß06±°xÓ0@ñ	BˆàÐÑ"3Ð8°SÓ8Ð3Ð"3Ðr   )TTFT)NNF)ÚYesÚNoNNF)Ú__doc__Útypingr   r   r   r   Úcertbot._internal.displayr   ÚOKÚCANCELÚWIDTHÚstrr   Úboolr   Úintr   r!   r%   r(   r*   r.   © r   r   ú<module>r;      s|  ðñ
õ Ý Ý Ý å )ð 	‡V�V€Ø 3à	�‰€Ø 9à
€ðQ�ð Q˜ó Qð AEØCGñ[˜#ð [ dð [¸ð [Ø$(ð[Ø<@ð[ØLPó[ð& CGØ#(ñG�#ð G  d¨3¡i°°e¸CÀ¸H±oÑ1FÐ&FÑ Gð GØ˜3‘-ðGØ2:¸3±-ðGà ðGà-2°3¸°8©_óGð8 W[Ø).ñH˜ð H h¨s¡mð HÀhÈsÁmð HØ"&ðHØ38¸¸c¸±?óHð( AEØDHØ$)ñ[�3ð [ 3ð [¸#ð [Ø˜D‘>ð[Ø4<¸S±Mð[à!ð[à.2ó[ð0 MQØ(,Ø(-ñL�sð L $ s¡)ð L°h¸tÀC¹yÑ6Ið LØ  ™ðLà!%ðLà27¸¸TÀ#¹Y¸Ñ2GóLð, ]aØ/4ñS˜cð S¨H°S©Mð SÈHÐUXÉMð SØ(,ðSØ9>¸sÀC¸x¹óSð&9˜cð 9¨Cð 9¸3ð 9ÐSWð 9Ð\`ô 9r   