~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.22 by Karl Fogel
Add the copyright header block to the remaining .py 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
5217.6.11 by Celso Providelo
Fixing bug#172275 (switching partner archive generation from NMAF to a-f).
6
# pylint: disable-msg=C0103,W0403
1932 by Canonical.com Patch Queue Manager
Merge in publishing work from soyuz sprint. r=jamesh
7
3496.1.113 by Celso Providelo
Add the ability to specify a single target suite in publish-distro script.
8
import _pythonpath
9
2785.2.3 by Daniel Silverstone
Tidying the carefulness
10
from optparse import OptionParser
1932 by Canonical.com Patch Queue Manager
Merge in publishing work from soyuz sprint. r=jamesh
11
4687.5.18 by Celso Providelo
more review comments, r=salgado.
12
from canonical.config import config
3496.1.113 by Celso Providelo
Add the ability to specify a single target suite in publish-distro script.
13
from canonical.launchpad.scripts import (
8303.14.13 by Julian Edwards
Fix some more circular imports and other bad import lines.
14
    execute_zcml_for_scripts, logger)
8356.1.9 by Leonard Richardson
Renamed the base script module in scripts/, which module_rename.py didn't touch because it wasn't under lib/.
15
from lp.services.scripts.base import LaunchpadScriptFailure
3496.1.113 by Celso Providelo
Add the ability to specify a single target suite in publish-distro script.
16
from canonical.lp import initZopeless
8303.14.13 by Julian Edwards
Fix some more circular imports and other bad import lines.
17
from lp.soyuz.scripts import publishdistro
3691.93.6 by Christian Reis
Checkpoint first part of publisher refactoring: moving code from publish-distro to Publishing, seriously.
18
19
5596.2.1 by Julian Edwards
Make test_publishdistro quicker. Also add --private-ppa option to publish-distro.py
20
if __name__ == "__main__":
3691.93.6 by Christian Reis
Checkpoint first part of publisher refactoring: moving code from publish-distro to Publishing, seriously.
21
    parser = OptionParser()
5596.2.1 by Julian Edwards
Make test_publishdistro quicker. Also add --private-ppa option to publish-distro.py
22
    publishdistro.add_options(parser)
23
    options, args = parser.parse_args()
3691.93.6 by Christian Reis
Checkpoint first part of publisher refactoring: moving code from publish-distro to Publishing, seriously.
24
    assert len(args) == 0, "publish-distro takes no arguments, only options."
25
26
    log = logger(options, "publish-distro")
3691.443.9 by Celso Providelo
fixing script initialization and test variable name.
27
    log.debug("Initialising zopeless.")
5821.5.14 by James Henstridge
Run execute_zcml_for_scripts() before initZopeless() in many tests.
28
    execute_zcml_for_scripts()
4687.5.18 by Celso Providelo
more review comments, r=salgado.
29
    txn = initZopeless(dbuser=config.archivepublisher.dbuser)
3691.443.9 by Celso Providelo
fixing script initialization and test variable name.
30
3691.448.12 by Celso Providelo
Add publish-ppa script, Publisher builders for each context (distribution and ppa), top-level ArchiveIndex writers and tests
31
    try:
5596.2.1 by Julian Edwards
Make test_publishdistro quicker. Also add --private-ppa option to publish-distro.py
32
        publishdistro.run_publisher(options, txn)
33
    except LaunchpadScriptFailure, err:
34
        log.error(err)