Part of lp.translations.scripts
POFileTranslatormore or less consistent with the real data.
|Function||get_pofile_ids||Retrieve ids of POFiles to scrub.|
|Function||summarize_pofiles||Retrieve relevant parts of `POFile`s with given ids.|
|Function||get_potmsgset_ids||Get the ids for each current
|Function||summarize_contributors||Return the set of ids of persons who contributed to a
|Function||get_contributions||Map all users' most recent contributions to a
|Function||gather_work_items||Produce `WorkItem`s for those `POFile`s that need fixing.|
|Function||preload_work_items||Bulk load data that will be needed to process
|Class||ScrubPOFileTranslator||Tunable loop, meant for running from inside Garbo.|
The result's ordering is aimed at maximizing cache effectiveness: by POTemplate name for locality of shared POTMsgSets, and by language for locality of shared TranslationMessages.
Retrieve relevant parts of `POFile`s with given ids. This gets just enough information to determine whether any of the `POFile`s need their `POFileTranslator` records fixed. :param pofile_ids: Iterable of `POFile` ids. :return: Dict mapping each id in `pofile_ids` to a duple of `POTemplate` id and `Language` id for the associated `POFile`.
This leaves some small room for error: a contribution that is masked by a diverged entry in this POFile will nevertheless produce a POFileTranslator record. Fixing that would complicate the work more than it is probably worth.
|potmsgset_ids||The ids of the |
POFileTranslatorrecords that shouldn't be there.
POFileTranslatorrecords that were missing.
POFileneeds fixing. Load its data & fix it.
POFilewith given details need
|Parameters||template_id||id of the |
|language_id||id of the |
|potmsgset_ids||ids of the |
|Returns||Bool: does the existing set of |
Produce `WorkItem`s for those `POFile`s that need fixing. :param pofile_ids: An iterable of `POFile` ids to check. :param pofile_summaries: Dict as returned by `summarize_pofiles`. :return: A sequence of `WorkItem`s for those `POFile`s that need fixing.
POFileTranslatorrecords covered by