a ‚oedã @s€dZddlmZddlmZddlmZddlmZddlmZejZej Z dZ e dd œd d „Z d$e e e e e ddœdd„Zd%e eee eee e ffeeee e ee efdœdd„Zd&e ee ee e ee e fdœdd„Zd'e e e ee ee e e dœdd„Zd(e ee eee ee e ee ee fdœdd„Zd)e ee ee e ee e fdœdd „Ze e e e dd!œd"d#„ZdS)*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éHN)ÚmsgÚreturncCst ¡j|dddd�dS)zMDisplay a basic status message. :param str msg: message to display F)ÚpauseÚdecorateÚwrapN©rÚ get_displayÚ notification)r©rú5C:\Program Files\Certbot\pkgs\certbot\display\util.pyÚnotifysrTF)Úmessager r Úforce_interactiver r cCst ¡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 )r r rr Nr )rr r rr rrrr&sÿr)rÚchoicesÚdefaultÚcli_flagrr cCst ¡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 ©rrr)rrÚmenu)rrrrrrrrr8sÿr)rrrrr cCst ¡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)rrÚinput©rrrrrrrÚ input_textTsÿrÚYesÚNo)rÚ yes_labelÚno_labelrrrr cCst ¡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 )rr rrr)rrÚyesno)rrr rrrrrrr!hsÿr!)rÚtagsrrrr cCst ¡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)rrÚ checklist)rr"rrrrrrr#€sÿr#cCst ¡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)rrÚdirectory_selectrrrrr$–sÿr$)Úpromptrrrr cCs4d |¡}|r|d |¡7}|dus0|s0J|ƒ‚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)r%rrrrrrrÚassert_valid_call©s ÿr')TTFT)NNF)NNF)rrNNF)NNF)NNF)Ú__doc__ÚtypingrrrrZcertbot._internal.displayrZOKZCANCELZWIDTHÚstrrÚboolrÚintrrr!r#r$r'rrrrÚsZ      ÿÿ þ  þ ÿ ÿ þ þ þþ ÿ ÿ