l.t.b.t.TranslationLinksAggregator : class documentation

Part of lp.translations.browser.translationlinksaggregator View In Hierarchy

Known subclasses: lp.translations.browser.person.WorkListLinksAggregator, lp.translations.browser.tests.test_translationlinksaggregator.DumbAggregator

Aggregate `POFile`s and/or `POTemplate`s into meaningful targets.

Here, `POFile`s and `POTemplate`s are referred to collectively as
"sheets."
Method describe Overridable: return description of given translations link.
Method aggregate Aggregate sheets into a list of translation target descriptions.
Method _bundle Bundle sheets based on target: Product or SourcePackage.
Method _composeLink Produce a link to a POFile or POTemplate.
Method _getTemplate Return POTemplate for sheet.
Method _getLanguage Return language sheet is in, if sheet is an IPOFile.
Method _countLanguages Count languages among sheets.
Method _circumscribe Find the best common UI link to cover all of sheets.
def describe(self, target, link, covered_sheets):
Overridable: return description of given translations link.

:param target: `Product` or `SourcePackage`.
:param link: URL linking to `covered_sheets` in the UI.
:param covered_sheets: `POFile`s and/or `POTemplate`s being
    linked and described together.
:return: Some description that will get added to a list and
    returned by `aggregate`.
def _bundle(self, sheets):
Bundle `sheets` based on target: `Product` or `SourcePackage`.

:param sheets: Sequence of `POFile`s and/or `POTemplate`s.
:return: Dict mapping each targets to a list representing its
    `POFile`s and `POTemplate`s as found in `sheets`.
def _composeLink(self, sheet):
Produce a link to a POFile or POTemplate.
def _getTemplate(self, sheet):
Return POTemplate for sheet.
ParameterssheetA POTemplate or POFile.
def _getLanguage(self, sheet):
Return language sheet is in, if sheet is an IPOFile.
def _countLanguages(self, sheets):
Count languages among sheets.

A template's language is None, which also counts.

def _circumscribe(self, sheets):
Find the best common UI link to cover all of `sheets`.

:param sheets: List of `POFile`s and/or `POTemplate`s.
:return: Dict containing a set of links and the respective lists
    of `sheets` they cover.
def aggregate(self, sheets):
Aggregate sheets into a list of translation target descriptions.

Targets are aggregated into "sensible" chunks first.

ReturnsA list of whatever the implementation for describe returns for the sensible chunks.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.