Part of lp.translations.model.translationimportqueue View In Hierarchy
Method | __iter__ | See ITranslationImportQueue. |
Method | __getitem__ | See ITranslationImportQueue. |
Method | countEntries | See ITranslationImportQueue . |
Method | addOrUpdateEntry | See ITranslationImportQueue . |
Method | addOrUpdateEntriesFromTarball | See ITranslationImportQueue. |
Method | get | See ITranslationImportQueue. |
Method | getAllEntries | See ITranslationImportQueue. |
Method | getFirstEntryToImport | See ITranslationImportQueue. |
Method | getRequestTargets | See ITranslationImportQueue . |
Method | executeOptimisticApprovals | See ITranslationImportQueue . |
Method | executeOptimisticBlock | See ITranslationImportQueue. |
Method | cleanUpQueue | See ITranslationImportQueue . |
Method | remove | See ITranslationImportQueue. |
Method | _iterNeedsReview | Iterate over all entries in the queue that need review. |
Method | _getMatchingEntry | Find an entry that best matches the given parameters, if such an |
Method | _getFormatAndImporter | Get the appropriate format and importer for this upload. |
Method | _getFileObjectAndSize | Get the size of a seekable file object. |
Method | _iterTarballFiles | Iterate through all non-emtpy files in the tarball. |
Method | _makePath | Make the file path from the name stored in the tarball. |
Method | _isTranslationFile | Is this a translation file that should be uploaded? |
Method | _getQueryByFiltering | See ITranslationImportQueue. |
Method | _attemptToSet | Set potemplate or pofile on a TranslationImportQueueEntry . |
Method | _attemptToApprove | Attempt to approve one queue entry. |
Method | _getSlaveStore | Return the slave store for the import queue. |
Method | _getBlockableDirectories | Describe all directories where uploads are to be blocked. |
Method | _isBlockable | Is entry one that should be blocked according to blocklist ? |
Method | _cleanUpObsoleteEntries | Delete obsolete queue entries. |
Method | _cleanUpInactiveProductEntries | Delete queue entries for deactivated `Product`s. |
Method | _cleanUpObsoleteDistroEntries | Delete some queue entries for obsolete DistroSeries . |
When the user uploads a file, we need to figure out whether to update an existing entry or create a new one. There may be zero, one, or multiple entries that match the new upload. If it's more than one, that will be because one matching entry is more specific than the other. 'More specific' refers to how well the import location has been specified for this entry. There are three cases, ordered from least specific to most specific:
If no exactly matching entry can be found, the next more specific
entry is chosen, if it exists. If there is more than one such entry,
there is no best choice and TranslationImportQueueConflictError
is raised.
Returns | The matching entry or None, if no matching entry was found at all. |
Parameters | filename | Name of the uploaded file. |
content | Contents of the uploaded file. | |
format | Optional hard choice of format. If none is given, a format will be divined from the file's name and contents. | |
Returns | a tuple of the selected format and its importer. |
ITranslationImportQueue
.ITranslationImportQueue.
TranslationImportQueueEntry
.
This will do nothing if setting potemplate or pofile would clash with another entry.
Tests can override this to avoid unnecessary synchronization issues.
DistroSeries
idSourcePackageName
idProductSeries
idA TranslationImportQueueEntry
should be blocked if the tuple
of its distroseries.id, sourcepackagename.id, productseries.id,
and the directory component of its path is found in the result
set.
See _isBlockable
, which matches a queue entry against the set
returned by this method.
entry
one that should be blocked according to blocklist
?Parameters | entry | A TranslationImportQueueEntry that may be a
candidate for blocking. |
blocklist | A description of blockable directories as
returned by _getBlockableDirectories . |
Parameters | store | The Store to delete from. |
Returns | Number of entries deleted. |
Delete queue entries for deactivated `Product`s. :param store: The Store to delete from. :return: Number of entries deleted.