certbot.display.ops module
certbot.display.ops module
Contains UI methods for LE user operations.
certbot.display.ops.get_email(invalid: bool = False, **kwargs: Any) str[source]
Prompt for valid email address.
Parameters:
invalid (bool) – True if an invalid address was provided by the user
Returns:
e-mail address
Return type:
str
Raises:
errors.Error – if the user cancels
certbot.display.ops.choose_account(accounts: list[Account]) Account | None[source]
Choose an account.
Parameters:
accounts (list) – Containing at least one Account
certbot.display.ops.choose_values(values: list[str], question: str | None = None) list[str][source]
Display screen to let user pick one or multiple values from the provided list.
Parameters:
-
values (list) – Values to select from
-
question (str) – Question to ask to user while choosing values
Returns:
List of selected values
Return type:
list
certbot.display.ops.choose_names(installer: Installer | None, question: str | None = None) list[str][source]
Display screen to select domains to validate.
Parameters:
-
installer (
certbot.interfaces.Installer) – An installer object -
question (str) – Overriding default question to ask the user if asked to choose from domain names.
Returns:
List of selected names
certbot.display.ops.get_valid_domains(domains: Iterable[str]) list[str][source]
Helper method for choose_names that implements basic checks
on domain names
Parameters:
domains (list) – Domain names to validate
Returns:
List of valid domains
Return type:
list
certbot.display.ops.success_installation(domains: list[str]) None[source]
Display a box confirming the installation of HTTPS.
Parameters:
domains (list) – domain names which were enabled
certbot.display.ops.success_renewal(unused_domains: list[str]) None[source]
Display a box confirming the renewal of an existing certificate.
Parameters:
domains (list) – domain names which were renewed
certbot.display.ops.success_revocation(cert_path: str) None[source]
Display a message confirming a certificate has been revoked.
Parameters:
cert_path (list) – path to certificate which was revoked.
certbot.display.ops.report_executed_command(command_name: str, returncode: int, stdout: str, stderr: str) None[source]
Display a message describing the success or failure of an executed process (e.g. hook).
Parameters:
-
command_name (str) – Human-readable description of the executed command
-
returncode (int) – The exit code of the executed command
-
stdout (str) – The stdout output of the executed command
-
stderr (str) – The stderr output of the executed command
certbot.display.ops.validated_input(validator: Callable[[str], Any], *args: Any, **kwargs: Any) tuple[str, str][source]
Like input_text, but with validation.
Parameters:
-
validator (callable) – A method which will be called on the supplied input. If the method raises an
errors.Error, its text will be displayed and the user will be re-prompted. -
*args (list) – Arguments to be passed to
input_text. -
**kwargs (dict) – Arguments to be passed to
input_text.
Returns:
as input_text
Return type:
tuple
certbot.display.ops.validated_directory(validator: Callable[[str], Any], *args: Any, **kwargs: Any) tuple[str, str][source]
Like directory_select, but with validation.
Parameters:
-
validator (callable) – A method which will be called on the supplied input. If the method raises an
errors.Error, its text will be displayed and the user will be re-prompted. -
*args (list) – Arguments to be passed to
directory_select. -
**kwargs (dict) – Arguments to be passed to
directory_select.
Returns:
as directory_select
Return type:
tuple
谢谢你的反馈!