certbot.display.ops module

Contains UI methods for LE user operations.

certbot.display.ops.get_email(invalid: bool = False, optional: bool = True) str[source]

Prompt for valid email address.

Parameters:
  • invalid (bool) – True if an invalid address was provided by the user

  • optional (bool) – True if the user can use –register-unsafely-without-email to avoid providing an e-mail

Returns:

e-mail address

Return type:

str

Raises:

errors.Error – if the user cancels

certbot.display.ops.choose_account(accounts: List[Account]) Optional[Account][source]

Choose an account.

Parameters:

accounts (list) – Containing at least one Account

certbot.display.ops.choose_values(values: List[str], question: Optional[str] = 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: Optional[Installer], question: Optional[str] = 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

Return type:

list of str

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