mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-16 01:21:07 +00:00
Config file for import-bug-from-debian.
This commit is contained in:
commit
63f418c534
@ -18,15 +18,35 @@ Each \fIbug\fR may be provided either as a bug number or URL.
|
|||||||
|
|
||||||
.SH OPTIONS
|
.SH OPTIONS
|
||||||
.TP
|
.TP
|
||||||
|
.BR \-b ", " \-\-browserless
|
||||||
|
Don't open the bug in a browser at the end.
|
||||||
|
.TP
|
||||||
.BR \-h ", " \-\-help
|
.BR \-h ", " \-\-help
|
||||||
Display a help message and exit.
|
Display a help message and exit.
|
||||||
.TP
|
.TP
|
||||||
.BR \-n ", " \-\-dry\-run
|
.B \-l \fIINSTANCE\fR, \fB\-\-lpinstance\fR=\fIINSTANCE\fR
|
||||||
Use the LP staging server so that changes are not permanent.
|
Use the specified instance of Launchpad (e.g. "staging"), instead of
|
||||||
|
the default of "production".
|
||||||
.TP
|
.TP
|
||||||
.BR \-b ", " \-\-browserless
|
.B \-\-no\-conf
|
||||||
Don't open the bug in a browser at the end.
|
Do not read any configuration files, or configuration from environment
|
||||||
|
variables.
|
||||||
|
.SH ENVIRONMENT
|
||||||
|
All of the \fBCONFIGURATION VARIABLES\fR below are also supported as
|
||||||
|
environment variables.
|
||||||
|
Variables in the environment take precedence to those in configuration
|
||||||
|
files.
|
||||||
|
.SH CONFIGURATION VARIABLES
|
||||||
|
The following variables can be set in the environment or in
|
||||||
|
.BR ubuntu\-dev\-tools (5)
|
||||||
|
configuration files.
|
||||||
|
In each case, the script\-specific variable takes precedence over the
|
||||||
|
package\-wide variable.
|
||||||
|
.TP
|
||||||
|
.BR IMPORT_BUG_FROM_DEBIAN_LPINSTANCE ", " UBUNTUTOOLS_LPINSTANCE
|
||||||
|
The default value for \fB--lpinstance\fR.
|
||||||
|
.SH SEE ALSO
|
||||||
|
.BR ubuntu\-dev\-tools (5)
|
||||||
.SH AUTHORS
|
.SH AUTHORS
|
||||||
\fBimport\-bug\-from\-debian\fR was written by James Westby
|
\fBimport\-bug\-from\-debian\fR was written by James Westby
|
||||||
<james.westby@ubuntu.com>,
|
<james.westby@ubuntu.com>,
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python
|
||||||
# -*- coding: UTF-8 -*-
|
# -*- coding: UTF-8 -*-
|
||||||
|
|
||||||
# Copyright © 2009 James Westby <james.westby@ubuntu.com>
|
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
|
||||||
|
# 2010 Stefano Rivera <stefanor@ubuntu.com>
|
||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
#
|
#
|
||||||
@ -21,12 +22,15 @@
|
|||||||
#
|
#
|
||||||
# ##################################################################
|
# ##################################################################
|
||||||
|
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser, SUPPRESS_HELP
|
||||||
import re
|
import re
|
||||||
import SOAPpy
|
|
||||||
import sys
|
import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
from ubuntutools.lp.libsupport import (get_launchpad, translate_api_web)
|
|
||||||
|
import SOAPpy
|
||||||
|
|
||||||
|
from ubuntutools.config import UDTConfig
|
||||||
|
from ubuntutools.lp.libsupport import get_launchpad, translate_api_web
|
||||||
|
|
||||||
bug_re = re.compile(r"bug=(\d+)")
|
bug_re = re.compile(r"bug=(\d+)")
|
||||||
|
|
||||||
@ -39,21 +43,26 @@ debbugs = SOAPpy.SOAPProxy(url, namespace)
|
|||||||
#debbugs.config.dumpSOAPIn = 1
|
#debbugs.config.dumpSOAPIn = 1
|
||||||
|
|
||||||
parser = OptionParser(usage="%prog [option] bug ...")
|
parser = OptionParser(usage="%prog [option] bug ...")
|
||||||
parser.add_option("-n", "--dry-run",
|
|
||||||
help="Use the staging server so that changes are not permanent",
|
|
||||||
dest="dry_run", action="store_true")
|
|
||||||
parser.add_option("-b", "--browserless",
|
parser.add_option("-b", "--browserless",
|
||||||
help="Don't open the bug in the browser at the end",
|
help="Don't open the bug in the browser at the end",
|
||||||
dest="browserless", action="store_true")
|
dest="browserless", action="store_true")
|
||||||
|
parser.add_option("-l", "--lpinstance", metavar="INSTANCE",
|
||||||
|
help="Launchpad instance to connect to (default: production)",
|
||||||
|
dest="lpinstance", default=None)
|
||||||
|
parser.add_option("-n", "--dry-run",
|
||||||
|
help=SUPPRESS_HELP,
|
||||||
|
dest="lpinstance", action="store_const", const="staging")
|
||||||
|
parser.add_option("--no-conf", dest="no_conf", default=False,
|
||||||
|
help="Don't read config files or environment variables.",
|
||||||
|
action="store_true")
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
if options.dry_run:
|
config = UDTConfig(options.no_conf)
|
||||||
lp_server = 'staging'
|
if options.lpinstance is None:
|
||||||
else:
|
options.lpinstance = config.get_value("LPINSTANCE")
|
||||||
lp_server = 'production'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
lp = get_launchpad("ubuntu-dev-tools", lp_server)
|
lp = get_launchpad("ubuntu-dev-tools", options.lpinstance)
|
||||||
except IOError, msg:
|
except IOError, msg:
|
||||||
print msg
|
print msg
|
||||||
print "No credentials, can't continue"
|
print "No credentials, can't continue"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user