letsencrypt.reporter

Collects and displays information to the user.

class letsencrypt.reporter.Reporter(config)[source]

Bases: object

Collects and displays information to the user.

Variables:messages (queue.PriorityQueue) – Messages to be displayed to the user.
HIGH_PRIORITY = 0

High priority constant. See add_message.

MEDIUM_PRIORITY = 1

Medium priority constant. See add_message.

LOW_PRIORITY = 2

Low priority constant. See add_message.

_msg_type

alias of ReporterMsg

add_message(msg, priority, on_crash=True)[source]

Adds msg to the list of messages to be printed.

Parameters:
  • msg (str) – Message to be displayed to the user.
  • priority (int) – One of HIGH_PRIORITY, MEDIUM_PRIORITY, or LOW_PRIORITY.
  • on_crash (bool) – Whether or not the message should be printed if the program exits abnormally.
atexit_print_messages(pid=4879)[source]

Function to be registered with atexit to print messages.

Parameters:pid (int) – Process ID
print_messages()[source]

Prints messages to the user and clears the message queue.

If there is an unhandled exception, only messages for which on_crash is True are printed.