l.t.i.p.IPOTemplateSharingSubset(Interface) : interface documentation

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

A subset of sharing PO templates.
Object distribution Undocumented
Object product Undocumented
Object sourcepackagename Undocumented
Method getSharingPOTemplates Find all sharing templates of the given name.
Method getSharingPOTemplatesByRegex Find all sharing templates with names matching the given pattern.
Method getSharingPOTemplateIDs Find database ids of all sharing templates of the given name.
Method groupEquivalentPOTemplates Within given IProduct or IDistribution, find equivalent templates.
distribution =
Undocumented
product =
Undocumented
sourcepackagename =
Undocumented
def getSharingPOTemplates(potemplate_name):
Find all sharing templates of the given name.

For distributions this method requires that sourcepackagename is set.

Parameterspotemplate_nameThe name of the template for which to find sharing equivalents.
ReturnsA list of all potemplates of the same name from all series.
def getSharingPOTemplatesByRegex(name_pattern=None):
Find all sharing templates with names matching the given pattern.

If name_pattern is None, match is performed on the template name. Use with care as it may return all templates in a distribution!

Parametersname_patternA POSIX regular expression that the template is matched against.
ReturnsA list of all potemplates matching the pattern.
def getSharingPOTemplateIDs(potemplate_name):
Find database ids of all sharing templates of the given name.

For distributions this method requires that sourcepackagename is set. This avoids serialization of full POTemplate objects.

Parameterspotemplate_nameThe name of the template for which to find sharing equivalents.
ReturnsA list of database ids of all potemplates of the same name from all series.
def groupEquivalentPOTemplates(name_pattern=None):
Within given IProduct or IDistribution, find equivalent templates.

Partitions all templates in the given context into equivalence
classes. This means that is groups all templates together for which
the tuple (template.name, sourcepackagename.name) is identical. This
tuple is called the equivalence class. When working with a product,
sourcepackagename.name is always None, so effectively the name of
the template is the class.

:param name_pattern: an optional regex pattern indicating which
    template names are to be merged. If you're operating on
    a distribution, you may want to pass a this to avoid doing too
    much in one go.
:return: a dict mapping each equivalence class to a list of
    `POTemplate`s in that class, each sorted from most to least
    representative.
API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.