l.t.s.p.ExportResult : class documentation

Part of lp.translations.scripts.po_export_queue View In Hierarchy

The results of a translation export request.

This class has three main attributes:

Method __init__ Undocumented
Method setExportFile Attach an exported file to the result, for upload to the Librarian.
Method upload Upload exported file as set with setExportFile to the Librarian.
Method notify Send a notification email to the given person about the export.
Method addFailure Store an exception that broke the export.
Method _getShortRequestName Return a short request name for use in email subjects.
Method _getExportRequestOrigin Figure out where an export request was made.
Method _getRequestedExportsNames Return a list of display names for requested exports.
Method _getFailureEmailBody Send an email notification about the export failing.
Method _getFailedRequestsDescription Return a printable description of failed export requests.
Method _getAdminFailureNotificationEmailBody Send an email notification about failed export to admins.
Method _getUnicodeDecodeErrorEmailBody Send an email notification to admins about UnicodeDecodeError.
Method _getSuccessEmailBody Send an email notification about the export working.
def __init__(self, person, requested_exports, logger):
Undocumented
def _getShortRequestName(self, request):
Return a short request name for use in email subjects.
def _getExportRequestOrigin(self):
Figure out where an export request was made.
def _getRequestedExportsNames(self):
Return a list of display names for requested exports.
def _getFailureEmailBody(self):
Send an email notification about the export failing.
def _getFailedRequestsDescription(self):
Return a printable description of failed export requests.
def _getAdminFailureNotificationEmailBody(self):
Send an email notification about failed export to admins.
def _getUnicodeDecodeErrorEmailBody(self):
Send an email notification to admins about UnicodeDecodeError.
def _getSuccessEmailBody(self):
Send an email notification about the export working.
def setExportFile(self, exported_file):
Attach an exported file to the result, for upload to the Librarian.

After this is set, upload will perform the actual upload. The two actions are separated so as to isolate write access to the database.

Parametersexported_fileAn IExportedTranslationFile containing the exported data.
def upload(self, logger=None):
Upload exported file as set with setExportFile to the Librarian.

If no file has been set, do nothing.

def notify(self):
Send a notification email to the given person about the export.

If there is a failure, a copy of the email is also sent to the Launchpad error mailing list for debugging purposes.

def addFailure(self):
Store an exception that broke the export.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.