10637.3.1
by Guilherme Salgado
Use the default python version instead of a hard-coded version |
1 |
#!/usr/bin/python -S
|
9072.1.2
by Danilo Šegan
Provide a quicker script to update pofile stats only on recently modified POFiles. |
2 |
#
|
3 |
# Copyright 2009 Canonical Ltd. This software is licensed under the
|
|
4 |
# GNU Affero General Public License version 3 (see the file LICENSE).
|
|
5 |
||
6 |
# pylint: disable-msg=W0403
|
|
7 |
||
8 |
"""Refresh and verify cached statistics for recently touched POFiles."""
|
|
9 |
||
10 |
import _pythonpath |
|
11 |
||
12 |
from lp.services.scripts.base import LaunchpadCronScript |
|
13 |
from lp.translations.scripts.verify_pofile_stats import ( |
|
14 |
VerifyRecentPOFileStatsProcess) |
|
15 |
||
16 |
||
17 |
class VerifyRecentPOFileStats(LaunchpadCronScript): |
|
18 |
"""Go through recently touched `POFile`s and update their statistics."""
|
|
19 |
||
20 |
def main(self): |
|
21 |
verifier = VerifyRecentPOFileStatsProcess(self.txn, self.logger) |
|
22 |
verifier.run() |
|
23 |
||
24 |
||
25 |
if __name__ == '__main__': |
|
26 |
script = VerifyRecentPOFileStats(name="pofile-stats-daily", |
|
27 |
dbuser='pofilestats_daily') |
|
28 |
script.lock_and_run() |