~launchpad-pqm/launchpad/devel

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
6286.3.2 by Celso Providelo
Implementing process-pending-packagediffs.py script.
6
# pylint: disable-msg=C0103,W0403
7
"""Process pending PackageDiffs.
8
9
Process a optionally limited set of pending PackageDiffs.
10
11
By default it process up to 50 diffs each run, which is enough to catch
6286.3.5 by Celso Providelo
applying review comments, r=gmb.
12
up on 1 hour of uploads (on average).
6286.3.2 by Celso Providelo
Implementing process-pending-packagediffs.py script.
13
6286.3.5 by Celso Providelo
applying review comments, r=gmb.
14
However users might benefit for more frequently runs since the diff ETA
6286.3.2 by Celso Providelo
Implementing process-pending-packagediffs.py script.
15
relative to the upload will be shorter.
16
6286.3.5 by Celso Providelo
applying review comments, r=gmb.
17
The cycle time needs to be balanced with the run time to produce the shortest
18
diff ETA and to not overlap much, for instance, if it has to diff monster
6286.3.2 by Celso Providelo
Implementing process-pending-packagediffs.py script.
19
sources like openoffice or firefox.
20
21
Experiments with the cycle time will be safe enough and won't sink the host
22
performance, since the lock file is exclusive.
23
"""
24
25
__metaclass__ = type
26
27
import _pythonpath
28
14605.1.1 by Curtis Hovey
Moved canonical.config to lp.services.
29
from lp.services.config import config
8294.6.1 by Julian Edwards
First stab at code-reorg. Still got a discrepancy on stuff I assigned to registry but not migrated yet.
30
from lp.soyuz.scripts.packagediff import ProcessPendingPackageDiffs
6286.3.2 by Celso Providelo
Implementing process-pending-packagediffs.py script.
31
14612.2.8 by William Grant
cronscripts
32
6286.3.2 by Celso Providelo
Implementing process-pending-packagediffs.py script.
33
if __name__ == '__main__':
34
    script = ProcessPendingPackageDiffs(
35
        'process-pending-packagediffs', dbuser=config.uploader.dbuser)
6286.3.5 by Celso Providelo
applying review comments, r=gmb.
36
    script.lock_and_run()