~launchpad-pqm/launchpad/devel

4829.1.1 by Jeroen Vermeulen
Implementing translation-statistics-sanity-checks spec.
1
#!/usr/bin/python2.4
2
# Copyright 2007 Canonical Ltd.  All rights reserved.
4935.3.7 by Curtis Hovey
Added bad name suppression to cronscripts.
3
# pylint: disable-msg=C0103,W0403
4829.1.1 by Jeroen Vermeulen
Implementing translation-statistics-sanity-checks spec.
4
5
"""Refresh and verify cached POFile translation statistics."""
6
7
from canonical.launchpad.scripts.base import LaunchpadCronScript
8
from canonical.launchpad.scripts.verify_pofile_stats import (
4829.1.2 by Jeroen Vermeulen
Also try running cron script.
9
    VerifyPOFileStatsProcess)
4829.1.1 by Jeroen Vermeulen
Implementing translation-statistics-sanity-checks spec.
10
11
12
class VerifyPOFileStats(LaunchpadCronScript):
4829.1.5 by Jeroen Vermeulen
Changes based on review.
13
    """Trawl `POFile` table, verifying and updating cached statistics."""
14
4829.1.1 by Jeroen Vermeulen
Implementing translation-statistics-sanity-checks spec.
15
    def main(self):
16
        VerifyPOFileStatsProcess(self.txn, self.logger).run()
17
18
19
if __name__ == '__main__':
4829.1.2 by Jeroen Vermeulen
Also try running cron script.
20
    script = VerifyPOFileStats(name="pofile-stats")
4829.1.1 by Jeroen Vermeulen
Implementing translation-statistics-sanity-checks spec.
21
    script.lock_and_run()
22