mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-05-17 11:51:29 +00:00
Port import-bug-from-debian to Python 3
Use python3-debianbts for BTS wrangling, rather than SOAPPy, which wasn't ported to Python 3.
This commit is contained in:
parent
d681c7dc89
commit
66afe7c6fc
4
debian/control
vendored
4
debian/control
vendored
@ -24,11 +24,11 @@ Build-Depends:
|
|||||||
python-launchpadlib (>= 1.5.7),
|
python-launchpadlib (>= 1.5.7),
|
||||||
python-mock,
|
python-mock,
|
||||||
python-setuptools,
|
python-setuptools,
|
||||||
python-soappy,
|
|
||||||
python-unittest2,
|
python-unittest2,
|
||||||
python3-all,
|
python3-all,
|
||||||
python3-apt,
|
python3-apt,
|
||||||
python3-debian,
|
python3-debian,
|
||||||
|
python3-debianbts,
|
||||||
python3-distro-info,
|
python3-distro-info,
|
||||||
python3-flake8,
|
python3-flake8,
|
||||||
python3-httplib2,
|
python3-httplib2,
|
||||||
@ -87,8 +87,8 @@ Recommends:
|
|||||||
lintian,
|
lintian,
|
||||||
patch,
|
patch,
|
||||||
pbuilder | cowbuilder | sbuild,
|
pbuilder | cowbuilder | sbuild,
|
||||||
|
python3-debianbts,
|
||||||
python3-dns,
|
python3-dns,
|
||||||
python-soappy,
|
|
||||||
quilt,
|
quilt,
|
||||||
reportbug (>= 3.39ubuntu1),
|
reportbug (>= 3.39ubuntu1),
|
||||||
ubuntu-keyring | ubuntu-archive-keyring,
|
ubuntu-keyring | ubuntu-archive-keyring,
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python3
|
||||||
# -*- coding: UTF-8 -*-
|
# -*- coding: UTF-8 -*-
|
||||||
|
|
||||||
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
|
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
|
||||||
@ -33,23 +33,15 @@ from ubuntutools.config import UDTConfig
|
|||||||
from ubuntutools.logger import Logger
|
from ubuntutools.logger import Logger
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import SOAPpy
|
import debianbts
|
||||||
except ImportError:
|
except ImportError:
|
||||||
Logger.error("Please install 'python-soappy' in order to use this utility.")
|
Logger.error("Please install 'python3-debianbts' in order to use this utility.")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
bug_re = re.compile(r"bug=(\d+)")
|
bug_re = re.compile(r"bug=(\d+)")
|
||||||
|
|
||||||
url = 'http://bugs.debian.org/cgi-bin/soap.cgi'
|
|
||||||
namespace = 'Debbugs/SOAP'
|
|
||||||
debbugs = SOAPpy.SOAPProxy(url, namespace)
|
|
||||||
|
|
||||||
# debug
|
|
||||||
# debbugs.config.dumpSOAPOut = 1
|
|
||||||
# debbugs.config.dumpSOAPIn = 1
|
|
||||||
|
|
||||||
parser = OptionParser(usage="%prog [option] bug ...")
|
parser = OptionParser(usage="%prog [option] bug ...")
|
||||||
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",
|
||||||
@ -94,7 +86,7 @@ def main():
|
|||||||
bug_num = int(bug_num)
|
bug_num = int(bug_num)
|
||||||
bug_nums.append(bug_num)
|
bug_nums.append(bug_num)
|
||||||
|
|
||||||
bugs = debbugs.get_status(*bug_nums)
|
bugs = debianbts.get_status(*bug_nums)
|
||||||
|
|
||||||
if len(bug_nums) > 1:
|
if len(bug_nums) > 1:
|
||||||
bugs = bugs[0]
|
bugs = bugs[0]
|
||||||
@ -104,14 +96,14 @@ def main():
|
|||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
for bug in bugs:
|
for bug in bugs:
|
||||||
bug = bug.value
|
|
||||||
ubupackage = package = bug.source
|
ubupackage = package = bug.source
|
||||||
if options.package:
|
if options.package:
|
||||||
ubupackage = options.package
|
ubupackage = options.package
|
||||||
bug_num = bug.bug_num
|
bug_num = bug.bug_num
|
||||||
subject = bug.subject
|
subject = bug.subject
|
||||||
log = debbugs.get_bug_log(bug_num)
|
summary = bug.summary
|
||||||
summary = log[0][0]
|
log = debianbts.get_bug_log(bug_num)
|
||||||
|
summary = log[0]['body']
|
||||||
target = ubuntu.getSourcePackage(name=ubupackage)
|
target = ubuntu.getSourcePackage(name=ubupackage)
|
||||||
if target is None:
|
if target is None:
|
||||||
Logger.error("Source package '%s' is not in Ubuntu. Please specify "
|
Logger.error("Source package '%s' is not in Ubuntu. Please specify "
|
||||||
|
2
setup.py
2
setup.py
@ -25,6 +25,7 @@ if sys.version_info[0] >= 3:
|
|||||||
'grab-merge',
|
'grab-merge',
|
||||||
'grep-merges',
|
'grep-merges',
|
||||||
'hugdaylist',
|
'hugdaylist',
|
||||||
|
'import-bug-from-debian',
|
||||||
'mk-sbuild',
|
'mk-sbuild',
|
||||||
'pbuilder-dist',
|
'pbuilder-dist',
|
||||||
'pbuilder-dist-simple',
|
'pbuilder-dist-simple',
|
||||||
@ -55,7 +56,6 @@ if sys.version_info[0] >= 3:
|
|||||||
]
|
]
|
||||||
else:
|
else:
|
||||||
scripts = [
|
scripts = [
|
||||||
'import-bug-from-debian',
|
|
||||||
'merge-changelog',
|
'merge-changelog',
|
||||||
]
|
]
|
||||||
data_files = []
|
data_files = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user