10637.3.1
by Guilherme Salgado
Use the default python version instead of a hard-coded version |
1 |
#!/usr/bin/python -S
|
8687.15.7
by Karl Fogel
Add the copyright header block to more files. |
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 |
||
4935.3.7
by Curtis Hovey
Added bad name suppression to cronscripts. |
6 |
# pylint: disable-msg=C0103,W0403
|
1845
by Canonical.com Patch Queue Manager
translation file downloading backend [r=Salgado] |
7 |
|
2125
by Canonical.com Patch Queue Manager
[r=bjornt] Cronscript refactorings |
8 |
import _pythonpath |
9 |
||
5842.1.1
by James Henstridge
Rename the transaction isolation level constants to match the psycopg2 |
10 |
from canonical.database.sqlbase import ISOLATION_LEVEL_READ_COMMITTED |
8751.1.1
by Danilo Šegan
Store migration changes so far. |
11 |
from lp.translations.scripts.po_export_queue import process_queue |
8356.1.1
by Leonard Richardson
Partial move. |
12 |
from lp.services.scripts.base import LaunchpadCronScript |
4264.2.1
by James Henstridge
add a LaunchpadCronScript subclass, and make cronscripts/*.py use it |
13 |
|
14 |
||
15 |
class RosettaExportQueue(LaunchpadCronScript): |
|
3691.348.18
by kiko
Convert most other scripts; 6 remain, of which one looks like it's going to be a bit tricky... |
16 |
def main(self): |
5842.1.1
by James Henstridge
Rename the transaction isolation level constants to match the psycopg2 |
17 |
self.txn.set_isolation_level(ISOLATION_LEVEL_READ_COMMITTED) |
3691.348.18
by kiko
Convert most other scripts; 6 remain, of which one looks like it's going to be a bit tricky... |
18 |
process_queue(self.txn, self.logger) |
19 |
||
1845
by Canonical.com Patch Queue Manager
translation file downloading backend [r=Salgado] |
20 |
|
21 |
if __name__ == '__main__': |
|
3691.348.18
by kiko
Convert most other scripts; 6 remain, of which one looks like it's going to be a bit tricky... |
22 |
script = RosettaExportQueue('rosetta-export-queue', dbuser='poexport') |
23 |
script.lock_and_run() |
|
1845
by Canonical.com Patch Queue Manager
translation file downloading backend [r=Salgado] |
24 |