l.s.m.notification : module documentation

Part of lp.services.mail

Event handlers that send email notifications.
Function send_process_error_notification Send a mail about an error occurring while using the email interface.
Function get_unified_diff Return a unified diff of the two texts.
def send_process_error_notification(to_address, subject, error_msg, original_msg, failing_command=None, max_return_size=MAX_RETURN_MESSAGE_SIZE):

Send a mail about an error occurring while using the email interface.

Tells the user that an error was encountered while processing their request and attaches the original email which caused the error to happen. The original message will be truncated to max_return_size bytes.

Unknown Field: to_addressThe address to send the notification to.
Unknown Field: subjectThe subject of the notification.
Unknown Field: error_msgThe error message that explains the error.
Unknown Field: original_msgThe original message sent by the user.
Unknown Field: failing_commandThe command that caused the error to happen.
Unknown Field: max_return_sizeThe maximum size returned for the original message.
def get_unified_diff(old_text, new_text, text_width):

Return a unified diff of the two texts.

Before the diff is produced, the texts are wrapped to the given text width.

>>> print get_unified_diff(
...     'Some text\nAnother line\n',get_un
...     'Some more text\nAnother line\n',
...     text_width=72)
- Some text
+ Some more text
  Another line
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.