Part of lp.translations.interfaces.webservice View In Hierarchy
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. |
If there is not entries with that id, the NotFoundError exception is raised.
The entry is either for a sourcepackage or a productseries, so only one of them can be specified.
Parameters | path | is the path, with the filename, of the uploaded file. |
content | is the file content, or a seekable file object open on the file content. | |
by_maintainer | indicates if the file was uploaded by the maintainer of the project or package. | |
importer | is the person that did the import. | |
sourcepackagename | is the link of this import with source package. | |
distroseries | is the link of this import with a distribution. | |
productseries | is the link of this import with a product branch. | |
potemplate | is the link of this import with an IPOTemplate. | |
pofile | is the link of this import with an IPOFile. | |
format | a TranslationFileFormat. | |
Returns | the entry, or None if processing failed. |
The entries are either for a sourcepackage or a productseries, so only one of them can be specified.
Parameters | content | is the tarball content, or a seekable file object open on the tarball. |
by_maintainer | indicates if the file was uploaded by the maintainer of the project or package. | |
importer | is the person that did the import. | |
sourcepackagename | is the link of this import with source package. | |
distroseries | is the link of this import with a distribution. | |
productseries | is the link of this import with a product branch. | |
potemplate | is the link of this import with an IPOTemplate. | |
approver_factory | is 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_templates | Flag to indicate that only translation templates in the tarball should be used. | |
Returns | A tuple of the number of successfully processed files and a list of those filenames that could not be processed correctly. |
If any of target, status or file_extension are given, the returned entries are filtered based on those values.
Parameters | target | IPerson, IProduct, IProductSeries, IDistribution, IDistroSeries or ISourcePackage the import entries are attached to or None to get all entries available. |
import_status | RosettaImportStatus entry. | |
file_extensions | Sequence of filename suffixes to match, usually 'po' or 'pot'. |
Parameters | target | IPerson, IProduct, IProductSeries, IDistribution, IDistroSeries or ISourcePackage the import entries are attached to or None to get all entries available. |
Product`s and `DistroSeries
with pending imports.
All returned items will implement IHasTranslationImports
.
Parameters | status | Filter by RosettaImportStatus . |
This method moves all entries that we know where should they be imported from the Needs Review status to the Accepted one.
Parameters | txn | Optional transaction manager. If given, will be committed regularly. |
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.
Parameters | txn | Optional transaction manager. If given, will be committed regularly. |
Returns | The number of items blocked. |