Part of lp.translations.interfaces.potemplate View In Hierarchy
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. |
For distributions this method requires that sourcepackagename is set.
Parameters | potemplate_name | The name of the template for which to find sharing equivalents. |
Returns | A list of all potemplates of the same name from all series. |
If name_pattern is None, match is performed on the template name. Use with care as it may return all templates in a distribution!
Parameters | name_pattern | A POSIX regular expression that the template is matched against. |
Returns | A list of all potemplates matching the pattern. |
For distributions this method requires that sourcepackagename is set. This avoids serialization of full POTemplate objects.
Parameters | potemplate_name | The name of the template for which to find sharing equivalents. |
Returns | A list of database ids of all potemplates of the same name from all series. |
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.