~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
4935.3.7 by Curtis Hovey
Added bad name suppression to cronscripts.
6
# pylint: disable-msg=C0103,W0403
3691.84.7 by James Henstridge
rename files
7
"""Upstream Product Release Finder.
1976 by Canonical.com Patch Queue Manager
dyson product release creator [r=dsilvers]
8
9
Scan FTP and HTTP sites specified for each ProductSeries in the database
10
to identify files and create new ProductRelease records for them.
11
"""
12
3691.7.2 by Stuart Bishop
Make dyson set path correctly
13
import _pythonpath
3691.105.4 by James Henstridge
update product-release-finder.py to use modularised version of code
14
14605.1.1 by Curtis Hovey
Moved canonical.config to lp.services.
15
from lp.services.config import config
8356.1.1 by Leonard Richardson
Partial move.
16
from lp.services.scripts.base import LaunchpadCronScript
7675.110.3 by Curtis Hovey
Ran the migration script to move registry code to lp.registry.
17
from lp.registry.scripts.productreleasefinder.finder import (
3691.105.4 by James Henstridge
update product-release-finder.py to use modularised version of code
18
    ProductReleaseFinder)
19
20
4264.2.1 by James Henstridge
add a LaunchpadCronScript subclass, and make cronscripts/*.py use it
21
class ReleaseFinderScript(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...
22
    def main(self):
23
        prf = ProductReleaseFinder(self.txn, self.logger)
24
        prf.findReleases()
1976 by Canonical.com Patch Queue Manager
dyson product release creator [r=dsilvers]
25
26
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...
27
    script = ReleaseFinderScript('productreleasefinder',
28
        dbuser=config.productreleasefinder.dbuser)
29
    script.lock_and_run()
30