M/ed"dZddlmZddlmZddlmZddlmZddlmZejZ ejZ dZ de d d fd Z dd e d e de de de d d f dZ d d e deee eee e ffdeedee de d ee eff dZ d d e dee dee de d ee e ff dZ d!d e de de dee dee de d e fdZ d d e dee deee dee de d ee ee ff dZ d d e dee dee de d ee e ff dZde de de de d d f dZy )"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)objHmsgreturnNcRtjj|dddy)zMDisplay a basic status message. :param str msg: message to display F)pausedecoratewrapNr get_display notification)r s 6/usr/lib/python3/dist-packages/certbot/display/util.pynotifyrs" OO""3ee%"Pmessager rforce_interactiver cTtjj|||||y)aDisplays 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 rrr Nr)rr rrr s rrr&s+OO""7%d5FQY#[rchoicesdefaultcli_flagcRtjj|||||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 rrr)rrmenu)rrrrrs rrr8s00 ??  ! !'7Gh4E " GGrcPtjj||||S)aAccept 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)rrinputrrrrs r input_textr!Ts. ??  " "7Gh5F # HHr yes_labelno_labelcTtjj||||||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#rrr)rryesno)rr"r#rrrs rr%r%hs4( ??  " "7i(\c,4HY # [[rtagscRtjj|||||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)rr checklist)rr&rrrs rr(r(s1$ ??  & &wgPX9J ' LLrcPtjj||||S)aDisplay 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)rrdirectory_selectr s rr*r*s/ ??  - -gwQY@Q . SSrpromptcjdj|}|r|dj|z }| |sJ|yy)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)r+rrrr s rassert_valid_callr.sK 7 = =f EC 006x0@ B  "38S8 3"3 r)TTFT)NNF)YesNoNNF)__doc__typingrrrrcertbot._internal.displayrOKCANCELWIDTHstrrboolrintrr!r%r(r*r.rrr;s| ) VV3 9 QQQAECG[#[d[[$([<@[LP[&CG#(G#Gd3ieCHo1F&F GG3-G2:3-G G-238_G8W[).HHhsmHhsmH"&H38c?H(AEDH$)[3[3[#[D>[4sCxS&9c9C939SW9\`9r