l.t.i.w.ITranslationImportQueue(Interface) : interface documentation

Part of lp.translations.interfaces.webservice View In Hierarchy

A set of files to be imported into Rosetta.
Method __iter__ Iterate over all entries in the queue.
Method __getitem__ Return the ITranslationImportQueueEntry with the given id.
Method countEntries Return the number of TranslationImportQueueEntry records.
Method addOrUpdateEntry Return a new or updated entry of the import queue.
Method addOrUpdateEntriesFromTarball Add all .po or .pot files from the tarball at :content:.
Method get Return the ITranslationImportQueueEntry with the given id or None.
Method getAllEntries Return all entries this import queue has.
Method getFirstEntryToImport Return the first entry of the queue ready to be imported.
Method getRequestTargets List Product`s and `DistroSeries with pending imports.
Method executeOptimisticApprovals Try to approve Needs-Review entries.
Method executeOptimisticBlock Try to move entries from the Needs Review status to Blocked one.
Method cleanUpQueue Remove old entries in terminal states.
Method remove Remove the given :entry: from the queue.
def __iter__():
Iterate over all entries in the queue.
def __getitem__(id):
Return the ITranslationImportQueueEntry with the given id.

If there is not entries with that id, the NotFoundError exception is raised.

def countEntries():
Return the number of TranslationImportQueueEntry records.
def addOrUpdateEntry(path, content, by_maintainer, importer, sourcepackagename=None, distroseries=None, productseries=None, potemplate=None, pofile=None, format=None):
Return a new or updated entry of the import queue.

The entry is either for a sourcepackage or a productseries, so only one of them can be specified.

Parameterspathis the path, with the filename, of the uploaded file.
contentis the file content, or a seekable file object open on the file content.
by_maintainerindicates if the file was uploaded by the maintainer of the project or package.
importeris the person that did the import.
sourcepackagenameis the link of this import with source package.
distroseriesis the link of this import with a distribution.
productseriesis the link of this import with a product branch.
potemplateis the link of this import with an IPOTemplate.
pofileis the link of this import with an IPOFile.
formata TranslationFileFormat.
Returnsthe entry, or None if processing failed.
def addOrUpdateEntriesFromTarball(content, by_maintainer, importer, sourcepackagename=None, distroseries=None, productseries=None, potemplate=None, filename_filter=None, approver_factory=None, only_templates=False):
Add all .po or .pot files from the tarball at :content:.

The entries are either for a sourcepackage or a productseries, so only one of them can be specified.

Parameterscontentis the tarball content, or a seekable file object open on the tarball.
by_maintainerindicates if the file was uploaded by the maintainer of the project or package.
importeris the person that did the import.
sourcepackagenameis the link of this import with source package.
distroseriesis the link of this import with a distribution.
productseriesis the link of this import with a product branch.
potemplateis the link of this import with an IPOTemplate.
approver_factoryis a factory that can be called to create an approver. The method invokes the approver on any queue entries that it creates. If this is None, no approval is performed.
only_templatesFlag to indicate that only translation templates in the tarball should be used.
ReturnsA tuple of the number of successfully processed files and a list of those filenames that could not be processed correctly.
def get(id):
Return the ITranslationImportQueueEntry with the given id or None.
@collection_default_content()
@operation_parameters(copy_field(ITranslationImportQueueEntry['status']))
@operation_returns_collection_of(ITranslationImportQueueEntry)
@export_read_operation()
def getAllEntries(target=None, import_status=None, file_extensions=None):
Return all entries this import queue has.

If any of target, status or file_extension are given, the returned entries are filtered based on those values.

ParameterstargetIPerson, IProduct, IProductSeries, IDistribution, IDistroSeries or ISourcePackage the import entries are attached to or None to get all entries available.
import_statusRosettaImportStatus entry.
file_extensionsSequence of filename suffixes to match, usually 'po' or 'pot'.
@export_read_operation()
@operation_parameters(Reference(IHasTranslationImports))
@operation_returns_entry(ITranslationImportQueueEntry)
def getFirstEntryToImport(target=None):
Return the first entry of the queue ready to be imported.
ParameterstargetIPerson, IProduct, IProductSeries, IDistribution, IDistroSeries or ISourcePackage the import entries are attached to or None to get all entries available.
@export_read_operation()
@operation_parameters(copy_field(ITranslationImportQueueEntry['status']))
@operation_returns_collection_of(IHasTranslationImports)
@call_with(REQUEST_USER)
def getRequestTargets(user, status=None):
List Product`s and `DistroSeries with pending imports.

All returned items will implement IHasTranslationImports.

ParametersstatusFilter by RosettaImportStatus.
def executeOptimisticApprovals(txn=None):
Try to approve Needs-Review entries.

This method moves all entries that we know where should they be imported from the Needs Review status to the Accepted one.

ParameterstxnOptional transaction manager. If given, will be committed regularly.
def executeOptimisticBlock(txn=None):
Try to move entries from the Needs Review status to Blocked one.

This method moves uploaded translations for Blocked templates to the Blocked status as well. This lets you block a template plus all its present or future translations in one go.

ParameterstxnOptional transaction manager. If given, will be committed regularly.
ReturnsThe number of items blocked.
def cleanUpQueue():
Remove old entries in terminal states.

This "garbage-collects" entries from the queue based on their status (e.g. Deleted and Imported ones) and how long they have been in that status.

ReturnsThe number of entries deleted.
def remove(entry):
Remove the given :entry: from the queue.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.