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).
6
6
# pylint: disable-msg=C0103,W0403
10
from optparse import OptionParser
12
10
from canonical.config import config
13
from canonical.launchpad.scripts import (
14
execute_zcml_for_scripts, logger)
15
from lp.services.scripts.base import LaunchpadScriptFailure
16
from canonical.lp import initZopeless
17
from lp.soyuz.scripts import publishdistro
11
from lp.soyuz.scripts.publishdistro import PublishDistro
20
14
if __name__ == "__main__":
21
parser = OptionParser()
22
publishdistro.add_options(parser)
23
options, args = parser.parse_args()
24
assert len(args) == 0, "publish-distro takes no arguments, only options."
26
log = logger(options, "publish-distro")
27
log.debug("Initializing zopeless.")
28
execute_zcml_for_scripts()
29
txn = initZopeless(dbuser=config.archivepublisher.dbuser)
32
publishdistro.run_publisher(options, txn)
33
except LaunchpadScriptFailure, err:
15
script = PublishDistro(dbuser=config.archivepublisher.dbuser)