mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-04-19 22:31:07 +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-mock,
|
||||
python-setuptools,
|
||||
python-soappy,
|
||||
python-unittest2,
|
||||
python3-all,
|
||||
python3-apt,
|
||||
python3-debian,
|
||||
python3-debianbts,
|
||||
python3-distro-info,
|
||||
python3-flake8,
|
||||
python3-httplib2,
|
||||
@ -87,8 +87,8 @@ Recommends:
|
||||
lintian,
|
||||
patch,
|
||||
pbuilder | cowbuilder | sbuild,
|
||||
python3-debianbts,
|
||||
python3-dns,
|
||||
python-soappy,
|
||||
quilt,
|
||||
reportbug (>= 3.39ubuntu1),
|
||||
ubuntu-keyring | ubuntu-archive-keyring,
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/usr/bin/python
|
||||
#!/usr/bin/python3
|
||||
# -*- coding: UTF-8 -*-
|
||||
|
||||
# Copyright © 2009 James Westby <james.westby@ubuntu.com>,
|
||||
@ -33,23 +33,15 @@ from ubuntutools.config import UDTConfig
|
||||
from ubuntutools.logger import Logger
|
||||
|
||||
try:
|
||||
import SOAPpy
|
||||
import debianbts
|
||||
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)
|
||||
|
||||
|
||||
def main():
|
||||
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.add_option("-b", "--browserless",
|
||||
help="Don't open the bug in the browser at the end",
|
||||
@ -94,7 +86,7 @@ def main():
|
||||
bug_num = int(bug_num)
|
||||
bug_nums.append(bug_num)
|
||||
|
||||
bugs = debbugs.get_status(*bug_nums)
|
||||
bugs = debianbts.get_status(*bug_nums)
|
||||
|
||||
if len(bug_nums) > 1:
|
||||
bugs = bugs[0]
|
||||
@ -104,14 +96,14 @@ def main():
|
||||
sys.exit(1)
|
||||
|
||||
for bug in bugs:
|
||||
bug = bug.value
|
||||
ubupackage = package = bug.source
|
||||
if options.package:
|
||||
ubupackage = options.package
|
||||
bug_num = bug.bug_num
|
||||
subject = bug.subject
|
||||
log = debbugs.get_bug_log(bug_num)
|
||||
summary = log[0][0]
|
||||
summary = bug.summary
|
||||
log = debianbts.get_bug_log(bug_num)
|
||||
summary = log[0]['body']
|
||||
target = ubuntu.getSourcePackage(name=ubupackage)
|
||||
if target is None:
|
||||
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',
|
||||
'grep-merges',
|
||||
'hugdaylist',
|
||||
'import-bug-from-debian',
|
||||
'mk-sbuild',
|
||||
'pbuilder-dist',
|
||||
'pbuilder-dist-simple',
|
||||
@ -55,7 +56,6 @@ if sys.version_info[0] >= 3:
|
||||
]
|
||||
else:
|
||||
scripts = [
|
||||
'import-bug-from-debian',
|
||||
'merge-changelog',
|
||||
]
|
||||
data_files = []
|
||||
|
Loading…
x
Reference in New Issue
Block a user