~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to cronscripts/supermirror-pull.py

  • Committer: Launchpad Patch Queue Manager
  • Date: 2011-12-22 04:45:35 UTC
  • mfrom: (14565.2.24 apocalyptic-pieces)
  • Revision ID: launchpad@pqm.canonical.com-20111222044535-jbjyzq3hzwiy7g20
[rs=sinzui][no-qa] Move javascript and scripts to lp. Dismantle
 mailnotification.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/python -S
2
2
#
3
 
# Copyright 2009 Canonical Ltd.  This software is licensed under the
 
3
# Copyright 2009-2011 Canonical Ltd.  This software is licensed under the
4
4
# GNU Affero General Public License version 3 (see the file LICENSE).
5
5
 
6
6
# pylint: disable-msg=C0103,W0403
7
7
 
 
8
from optparse import OptionParser
 
9
 
8
10
import _pythonpath
9
 
from optparse import OptionParser
10
 
 
11
 
from twisted.internet import defer, reactor
 
11
from twisted.internet import (
 
12
    defer,
 
13
    reactor,
 
14
    )
12
15
from twisted.python import log as tplog
13
16
 
14
17
from canonical.config import config
15
 
from canonical.launchpad.scripts import logger_options
16
 
from lp.codehosting.puller import mirror, scheduler
 
18
from lp.codehosting.puller import (
 
19
    mirror,
 
20
    scheduler,
 
21
    )
 
22
from lp.services.scripts import logger_options
17
23
from lp.services.twistedsupport.loggingsupport import (
18
 
    LoggingProxy, set_up_logging_for_script)
 
24
    LoggingProxy,
 
25
    set_up_logging_for_script,
 
26
    )
 
27
 
19
28
 
20
29
def clean_shutdown(ignored):
21
30
    reactor.stop()
42
51
    (options, arguments) = parser.parse_args()
43
52
    if arguments:
44
53
        parser.error("Unhandled arguments %s" % repr(arguments))
45
 
    log = set_up_logging_for_script(options, 'supermirror_puller', options.log_file)
 
54
    log = set_up_logging_for_script(
 
55
        options, 'supermirror_puller', options.log_file)
46
56
    manager = scheduler.JobScheduler(
47
57
        LoggingProxy(config.codehosting.codehosting_endpoint, log), log,
48
58
        options.branch_type)