~launchpad-pqm/launchpad/devel

« back to all changes in this revision

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

  • Committer: Launchpad Patch Queue Manager
  • Date: 2012-01-04 23:59:50 UTC
  • mfrom: (14621.1.4 xss_911632)
  • Revision ID: launchpad@pqm.canonical.com-20120104235950-13dqftqbpu1zxcdh
[r=abentley][bug=911632] Fix template to escape output of no branch
        message.

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
    MAIN_STORE,
35
35
    )
36
36
from lp.translations.interfaces.pofilestatsjob import IPOFileStatsJobSource
37
 
from lp.translations.interfaces.potemplate import IPOTemplateSet
38
37
from lp.translations.model.pofile import POFile
39
38
 
40
39
 
75
74
        logger.info('Updating statistics for %s' % self.pofile.title)
76
75
        self.pofile.updateStatistics()
77
76
 
78
 
        # Next we have to find any POFiles that share translations with the
79
 
        # above POFile so we can update their statistics too.  To do that we
80
 
        # first have to find the set of shared templates.
81
 
        subset = getUtility(IPOTemplateSet).getSharingSubset(
82
 
            product=self.pofile.potemplate.product,
83
 
            distribution=self.pofile.potemplate.distribution,
84
 
            sourcepackagename=self.pofile.potemplate.sourcepackagename)
85
 
        shared_templates = subset.getSharingPOTemplates(
86
 
            self.pofile.potemplate.name)
87
 
        # Now we have to find any POFiles that translate the shared templates
88
 
        # into the same language as the POFile this job is about.
89
 
        for template in shared_templates:
90
 
            pofile = template.getPOFileByLang(self.pofile.language.code)
91
 
            if pofile is None:
92
 
                continue
93
 
            pofile.updateStatistics()
94
 
 
95
77
    @staticmethod
96
78
    def iterReady():
97
79
        """See `IJobSource`."""