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 ( |
|
14612.2.8
by William Grant
cronscripts |
14 |
VerifyRecentPOFileStatsProcess, |
15 |
)
|
|
9072.1.2
by Danilo Šegan
Provide a quicker script to update pofile stats only on recently modified POFiles. |
16 |
|
17 |
||
18 |
class VerifyRecentPOFileStats(LaunchpadCronScript): |
|
19 |
"""Go through recently touched `POFile`s and update their statistics."""
|
|
20 |
||
21 |
def main(self): |
|
22 |
verifier = VerifyRecentPOFileStatsProcess(self.txn, self.logger) |
|
23 |
verifier.run() |
|
24 |
||
25 |
||
26 |
if __name__ == '__main__': |
|
27 |
script = VerifyRecentPOFileStats(name="pofile-stats-daily", |
|
28 |
dbuser='pofilestats_daily') |
|
29 |
script.lock_and_run() |