~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/translations/model/potemplate.py

[r=danilo][ui=none] Tests & simplification for
        TranslationTemplatesCollection.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
1
# Copyright 2009-2010 Canonical Ltd.  This software is licensed under the
2
2
# GNU Affero General Public License version 3 (see the file LICENSE).
3
3
 
4
4
# pylint: disable-msg=E0611,W0212
92
92
'''
93
93
 
94
94
standardTemplateHeader = (
95
 
"Project-Id-Version: %(origin)s\n"
96
 
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
97
 
"POT-Creation-Date: %(templatedate)s\n"
98
 
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
99
 
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
100
 
"Language-Team: %(languagename)s <%(languagecode)s@li.org>\n"
101
 
"MIME-Version: 1.0\n"
102
 
"Content-Type: text/plain; charset=UTF-8\n"
103
 
"Content-Transfer-Encoding: 8bit\n"
104
 
)
 
95
    "Project-Id-Version: %(origin)s\n"
 
96
    "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
 
97
    "POT-Creation-Date: %(templatedate)s\n"
 
98
    "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 
99
    "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 
100
    "Language-Team: %(languagename)s <%(languagecode)s@li.org>\n"
 
101
    "MIME-Version: 1.0\n"
 
102
    "Content-Type: text/plain; charset=UTF-8\n"
 
103
    "Content-Transfer-Encoding: 8bit\n")
105
104
 
106
105
 
107
106
standardPOFileHeader = (standardTemplateHeader +
1380
1379
        self.sourcepackagename = sourcepackagename
1381
1380
        self.product = product
1382
1381
 
1383
 
 
1384
1382
    def _get_potemplate_equivalence_class(self, template):
1385
1383
        """Return whatever we group `POTemplate`s by for sharing purposes."""
1386
1384
        if template.sourcepackagename is None:
1588
1586
 
1589
1587
    def getTranslationTemplates(self):
1590
1588
        """See `IHasTranslationTemplates`."""
1591
 
        return self._orderTemplates(
1592
 
            self.getTemplatesCollection().select(POTemplate))
 
1589
        return self._orderTemplates(self.getTemplatesCollection().select())
1593
1590
 
1594
1591
    def getTranslationTemplateFormats(self):
1595
1592
        """See `IHasTranslationTemplates`."""