Browse Source

Add changes from 3.29-3.29.1

suites/jessie-proposed-backports
Chris Lawrence 16 years ago
parent
commit
f411c921a6
  1. 2
      debian/changelog
  2. 105
      debianbts.py
  3. 46
      reportbug
  4. 17
      reportbug.py
  5. 4
      reportbug_submit.py
  6. 16
      reportbug_ui_newt.py
  7. 33
      reportbug_ui_text.py
  8. 80
      reportbug_ui_urwid.py

2
debian/changelog

@ -1,7 +1,7 @@
reportbug (3.99.1) experimental; urgency=low
* Start experimental fork of reportbug for 4.0 (likely post-etch).
* Incorporate changes from reportbug 3.27-3.28.
* Incorporate changes from reportbug 3.27-3.29.1.
--

105
debianbts.py

@ -2,7 +2,7 @@
# debianbts.py - Routines to deal with the debbugs web pages
#
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 1999-2005 Chris Lawrence
# (C) 1999-2006 Chris Lawrence
#
# This program is freely distributable per the following license:
#
@ -22,17 +22,17 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: debianbts.py,v 1.24 2006-08-14 04:59:11 lawrencc Exp $
# $Id: debianbts.py,v 1.25 2006-08-25 01:33:40 lawrencc Exp $
import sgmllib, glob, os, re, reportbug, rfc822, time, urllib, checkversions
from urlutils import open_url
from types import StringTypes
import sys
import mailbox
import email
import email.Errors
import cStringIO
import cgi
def msgfactory(fp):
try:
@ -393,19 +393,25 @@ def cgi_report_url(system, number, archived=False, mbox=False):
return None
def cgi_package_url(system, package, archived=False, source=False,
repeatmerged=True):
repeatmerged=True, version=None):
root = SYSTEMS[system].get('cgiroot')
if not root: return None
package = urllib.quote_plus(package.lower())
qtype = "pkg"
#package = urllib.quote_plus(package.lower())
if source:
qtype = "src"
repeat = yn_bool(repeatmerged)
archive = yn_bool(archived)
query = {'src' : package.lower()}
else:
query = {'pkg' : package.lower()}
query['repeatmerged'] = yn_bool(repeatmerged)
query['archived'] = yn_bool(archived)
return '%spkgreport.cgi?%s=%s&archived=%s&repeatmerged=%s&show_list_header=no&show_list_footer=no' % (root, qtype, package, archive, repeat)
if version:
query['version'] = str(version)
qstr = urllib.urlencode(query)
#print qstr
return '%spkgreport.cgi?%s' % (root, qstr)
def package_url(system, package, mirrors=None, source=False,
repeatmerged=True):
@ -493,6 +499,8 @@ class BTSParser(sgmllib.SGMLParser):
self.mode = mode
self.cgi = cgi
self.followups = followups
self.inbuglist = self.intrailerinfo = False
self.bugtitle = None
if followups:
self.preblock = []
else:
@ -513,19 +521,11 @@ class BTSParser(sgmllib.SGMLParser):
def save_end(self, mode=False):
data = self.savedata
if not mode and data:
data = ' '.join(data.split())
self.savedata = None
if not mode: data = ' '.join(data.split())
return data
def check_li(self):
if self.mode == 'summary':
data = self.save_end()
if data and data[0] == '#':
self.lidatalist.append(data)
self.bugcount += 1
self.lidata = False
def start_h1(self, attrs):
self.save_bgn()
self.oldmode = self.mode
@ -547,14 +547,49 @@ class BTSParser(sgmllib.SGMLParser):
self.hierarchy.append( (hiertitle, []) )
self.endh2 = True # We are at the end of a title, flag <pre>
def do_br(self, attrs):
if self.lidata and self.mode == 'summary': self.check_li()
def start_ul(self, attrs):
if self.mode == 'summary':
for k, v in attrs:
if k == 'class' and v == 'bugs':
self.inbuglist = True
def end_ul(self):
if self.inbuglist:
self.check_li()
self.inbuglist = False
def do_br(self, attrs):
if self.mode == 'title':
self.savedata = ""
def do_li(self, attrs):
elif self.mode == 'summary' and self.inbuglist and not self.intrailerinfo:
self.bugtitle = self.save_end()
self.intrailerinfo = True
self.save_bgn()
def check_li(self):
if self.mode == 'summary':
if not self.intrailerinfo:
self.bugtitle = self.save_end()
trailinfo = ''
else:
trailinfo = self.save_end()
match = re.search(r'fixed:\s+([\w.+~-]+(\s+[\w.+~:-]+)?)', trailinfo)
if match:
bugid, title = re.split(r':\s+', self.bugtitle, 1)
buginfo = '%s [FIXED %s]: %s' % (bugid, match.group(1),
title)
else:
buginfo = self.bugtitle
self.lidatalist.append(buginfo)
self.bugcount += 1
self.lidata = self.intrailerinfo = False
def do_li(self, attrs):
if self.mode == 'summary' and self.inbuglist:
if self.lidata: self.check_li()
self.lidata = True
@ -666,13 +701,16 @@ def parse_mbox_report(number, url, http_proxy, followups=False):
output.append(entry)
if not output:
return None
title = "#%d: %s" % (number, title)
return (title, output)
def get_cgi_reports(package, system='debian', http_proxy='', archived=False,
source=False):
page = open_url(cgi_package_url(system, package, archived, source),
http_proxy)
source=False, version=None):
page = open_url(cgi_package_url(system, package, archived, source,
version=version), http_proxy)
if not page:
return (0, None, None)
@ -702,12 +740,12 @@ def get_btsroot(system, mirrors=None):
return alternates[mirror]
return SYSTEMS[system].get('btsroot', '')
def get_reports(package, system='debian', mirrors=None,
def get_reports(package, system='debian', mirrors=None, version=None,
http_proxy='', archived=False, source=False):
if isinstance(package, StringTypes):
if isinstance(package, basestring):
if SYSTEMS[system].get('cgiroot'):
result = get_cgi_reports(package, system, http_proxy, archived,
source)
source, version=version)
if result: return result
url = package_url(system, package, mirrors, source)
@ -746,7 +784,8 @@ def get_report(number, system='debian', mirrors=None,
http_proxy='', archived=False, followups=False):
number = int(number)
if SYSTEMS[system].get('cgiroot'):
result = get_cgi_report(number, system, http_proxy, archived,followups)
result = get_cgi_report(number, system, http_proxy, archived,
followups)
if result: return result
url = report_url(system, number, mirrors)
@ -755,4 +794,4 @@ def get_report(number, system='debian', mirrors=None,
return parse_html_report(number, url, http_proxy, followups, cgi=False)
if __name__ == '__main__':
print get_cgi_report(183573)
print get_cgi_report(2)

46
reportbug

@ -22,7 +22,7 @@ ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
SOFTWARE."""
#
# Version ##VERSION##; see changelog for revision history
# $Id: reportbug,v 1.100 2006-08-18 16:08:33 lawrencc Exp $
# $Id: reportbug,v 1.101 2006-08-25 01:33:40 lawrencc Exp $
# Work around case where Python install might be broken (#290043)
try:
@ -100,7 +100,7 @@ def which_editor(default_editor=None):
return editor
def handle_editing(filename, dmessage, options, sendto, attachments, package,
editor=None):
editor=None, charset='utf-8'):
if not editor:
editor = options.editor
editor = which_editor(editor)
@ -109,7 +109,7 @@ def handle_editing(filename, dmessage, options, sendto, attachments, package,
while True:
if not skip_editing:
(message, changed) = ui.spawn_editor(message or dmessage, filename,
editor)
editor, charset)
skip_editing = False
if not message:
x = ''
@ -919,11 +919,6 @@ class UI(object):
if self.options.interface == 'text':
ewrite('*** Welcome to reportbug. Use ? for help at prompts. ***\n')
fromaddr = reportbug.get_user_id(self.options.email, self.options.realname)
ewrite("Using '%s' as your from address.\n", fromaddr)
if self.options.debugmode:
sendto = fromaddr
try:
blah = u'hello'.encode(charset)
except LookupError:
@ -936,6 +931,12 @@ class UI(object):
ewrite("Detected character set: %s\n"
"Please change your locale if this is incorrect.\n\n", charset)
fromaddr = reportbug.get_user_id(self.options.email, self.options.realname, charset)
ewrite("Using '%s' as your from address.\n", fromaddr.encode(charset, 'replace'))
fromaddr = fromaddr.encode('utf-8')
if self.options.debugmode:
sendto = fromaddr
edname = which_editor(self.options.editor)
baseedname = os.path.basename(edname)
if baseedname == 'sensible-editor':
@ -1107,6 +1108,7 @@ class UI(object):
(pkgversion, pkgavail, depends, recommends, conffiles, maintainer,
installed, origin, vendor, reportinfo, priority, desc, src_name,
fulldesc, state) = status
maintainer = maintainer.encode(charset, 'replace')
buginfo = '/usr/share/bug/' + package
bugexec = submitas = submitto = presubj = None
@ -1220,7 +1222,7 @@ class UI(object):
ewrite("Package originates from %s; overriding your system "
"selection.\n", vendor or origin)
bts = origin.lower()
reportinfo = None
sysinfo = debianbts.SYSTEMS[bts]
elif reportinfo:
ewrite("Unknown origin %s; will send to %s.\n", origin,
reportinfo[1])
@ -1267,7 +1269,10 @@ class UI(object):
pkg = src_name
try:
exinfo = ui.handle_bts_query(pkg, bts, self.options.mirrors,
self.options.http_proxy, source=src)
self.options.http_proxy,
source=src,
queryonly=self.options.queryonly,
version=pkgversion)
except UINotImplemented:
exinfo = None
except NoNetwork:
@ -1283,10 +1288,14 @@ class UI(object):
except NoBugs:
ewrite('No bug reports found.\n')
except NoReport:
ewrite('Nothing new to report; exiting.\n')
if self.options.queryonly:
ewrite('Exiting at user request.\n')
else:
ewrite('Nothing new to report; exiting.\n')
return
if self.options.queryonly: return
if self.options.queryonly:
return
ccaddr = os.environ.get('MAILCC')
if self.options.nocc:
@ -1295,9 +1304,7 @@ class UI(object):
bccaddr = os.environ.get('MAILBCC', fromaddr)
if maintainer:
lmaintainer = maintainer.decode('UTF-8', 'ignore').encode(
charset, 'replace')
ewrite("Maintainer for %s is '%s'.\n", package, lmaintainer)
ewrite("Maintainer for %s is '%s'.\n", package, maintainer)
if 'qa.debian.org' in maintainer:
ui.long_message('''\
This package is currently "orphaned"; if you are a current or prospective
@ -1576,7 +1583,7 @@ orphaned for a long period of time are often removed from the archive.\n''')
addinfo = None
if not self.options.noconf:
addinfo = "\n-- Package-specific info:\n"+file(filename).read()
addinfo = "\n-- Package-specific info:\n"+file(filename).read().decode('utf-8')
os.unlink(filename)
if addinfo and incfiles:
@ -1638,12 +1645,13 @@ orphaned for a long period of time are often removed from the archive.\n''')
if mailing:
fh, filename = TempFile(prefix=tfprefix)
fh.write(message)
fh.write(message.encode(charset, 'replace'))
fh.close()
oldmua = mua or self.options.mua
if not self.options.body and not self.options.bodyfile:
message = handle_editing(filename, message, self.options, sendto,
attachments, package)
message = handle_editing(filename, message, self.options,
sendto, attachments, package,
charset=charset)
if not oldmua and self.options.mua:
mua = self.options.mua
if mua:

17
reportbug.py

@ -21,7 +21,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: reportbug.py,v 1.36 2006-08-18 22:09:55 lawrencc Exp $
# $Id: reportbug.py,v 1.37 2006-08-25 01:33:40 lawrencc Exp $
VERSION = "reportbug ##VERSION##"
VERSION_NUMBER = "##VERSION##"
@ -185,7 +185,7 @@ def get_email_addr(addr):
def get_email(email='', realname=''):
return get_email_addr(get_user_id(email, realname))
def get_user_id(email='', realname=''):
def get_user_id(email='', realname='', charset='utf-8'):
uid = os.getuid()
info = pwd.getpwuid(uid)
email = (os.environ.get('REPORTBUGEMAIL', email) or
@ -215,6 +215,9 @@ def get_user_id(email='', realname=''):
if not realname:
return email
# Decode the realname from the charset
realname = realname.decode(charset, 'replace')
if re.match(r'[\w\s]+$', realname):
return '%s <%s>' % (realname, email)
@ -262,6 +265,9 @@ def get_package_status(package, avail=False):
output = commands.getoutput(
"COLUMNS=79 dpkg --status %s 2>/dev/null" % packarg)
# dpkg output is in UTF-8 format
output = output.decode('utf-8', 'replace')
for line in output.split(os.linesep):
line = line.rstrip()
if not line: continue
@ -354,16 +360,17 @@ def get_avail_database():
global avail
if not avail:
avail = commands.getoutput('apt-cache dumpavail 2>/dev/null').split('\n\n')
avail = commands.getoutput('apt-cache dumpavail 2>/dev/null')
if not avail:
if os.path.exists(AVAILDB):
avail = file(AVAILDB).read().split('\n\n')
avail = file(AVAILDB).read()
if not avail:
print >> sys.stderr, 'Unable to open', AVAILDB
sys.exit(1)
return avail
# output is in UTF-8 format
return avail.decode('utf-8', 'replace').split('\n\n')
def get_source_package(package):
"""Return any binary packages provided by a source package."""

4
reportbug_submit.py

@ -22,7 +22,7 @@
#
# Version ##VERSION##; see changelog for revision history
#
# $Id: reportbug_submit.py,v 1.20 2006-08-11 22:58:52 lawrencc Exp $
# $Id: reportbug_submit.py,v 1.21 2006-08-25 01:33:40 lawrencc Exp $
import sys
@ -255,7 +255,7 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
message = BetterMIMEText(body, _charset=charset)
# Standard headers
message['From'] = rfc2047_encode_address(fromaddr, charset, mua)
message['From'] = rfc2047_encode_address(fromaddr, 'utf-8', mua)
message['To'] = rfc2047_encode_address(sendto, charset, mua)
for (header, value) in headers:

16
reportbug_ui_newt.py

@ -18,12 +18,11 @@
## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
## SOFTWARE.
#
# $Id: reportbug_ui_newt.py,v 1.5 2006-08-10 02:36:14 lawrencc Exp $
# $Id: reportbug_ui_newt.py,v 1.6 2006-08-25 01:33:40 lawrencc Exp $
import commands, string, sys, snack, re, debianbts
from reportbug_exceptions import *
from urlutils import launch_browser
from types import StringTypes
ISATTY = sys.stdin.isatty()
@ -36,16 +35,7 @@ except:
def ewrite(message, *args):
# ewrite shouldn't do anything on newt... maybe should log to a file
# if specified.
if 1:
return
if not ISATTY:
return
if args:
sys.stderr.write(message % args)
else:
sys.stderr.write(message)
pass
log_message = ewrite
display_failure = ewrite
@ -219,7 +209,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
if not scr:
scr = newt_screen()
if isinstance(package, StringTypes):
if isinstance(package, basestring):
if source:
newt_infobox('Querying %s bug tracking system for reports on'
' src:%s\n' % (debianbts.SYSTEMS[bts]['name'],

33
reportbug_ui_text.py

@ -1,6 +1,6 @@
# Text user interface for reportbug
# Written by Chris Lawrence <lawrencc@debian.org>
# (C) 2001-04 Chris Lawrence
# (C) 2001-06 Chris Lawrence
#
# This program is freely distributable per the following license:
#
@ -18,12 +18,11 @@
## ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
## SOFTWARE.
#
# $Id: reportbug_ui_text.py,v 1.19 2006-08-15 20:12:38 lawrencc Exp $
# $Id: reportbug_ui_text.py,v 1.20 2006-08-25 01:33:40 lawrencc Exp $
import commands, sys, os, re, math, string, debianbts, errno, reportbug
from reportbug_exceptions import *
from urlutils import launch_browser
from types import StringTypes
import dircache
import glob
import getpass
@ -45,7 +44,10 @@ def ewrite(message, *args):
if not ISATTY:
return
sys.stderr.write(message % args)
if args:
sys.stderr.write(message % args)
else:
sys.stderr.write(message)
sys.stderr.flush()
log_message = ewrite
@ -195,7 +197,10 @@ def yes_no(msg, yeshelp, nohelp, default=True, nowrap=False):
return (res == 'y')
def long_message(text, *args):
ewrite(indent_wrap_text(text % args))
if args:
ewrite(indent_wrap_text(text % args))
else:
ewrite(indent_wrap_text(text))
final_message = long_message
@ -434,7 +439,7 @@ def show_report(number, system, mirrors,
def handle_bts_query(package, bts, mirrors=None, http_proxy="",
queryonly=False, title="", screen=None, archived='no',
source=False):
source=False, version=None):
import debianbts
root = debianbts.SYSTEMS[bts].get('btsroot')
@ -447,7 +452,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
if source:
srcstr = " (source)"
if isinstance(package, StringTypes):
if isinstance(package, basestring):
long_message('Querying %s BTS for reports on %s%s...\n',
debianbts.SYSTEMS[bts]['name'], package, srcstr)
else:
@ -458,19 +463,20 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
bugs = []
try:
(count, title, hierarchy)=debianbts.get_reports(
package, bts, mirrors=mirrors,
package, bts, mirrors=mirrors, version=version,
source=source, http_proxy=http_proxy, archived=archived)
if debianbts.SYSTEMS[bts].has_key('namefmt'):
package2 = debianbts.SYSTEMS[bts]['namefmt'] % package
(count2, title2, hierarchy2) = \
debianbts.get_reports(package2, bts,
mirrors=mirrors, source=source,
http_proxy=http_proxy)
http_proxy=http_proxy,
version=version)
count = count+count2
for entry in hierarchy2:
hierarchy.append( (package2+' '+entry[0], entry[1]) )
exp = re.compile(r'\#(\d+):')
exp = re.compile(r'#(\d+)[ :]')
for entry in hierarchy or []:
for bug in entry[1]:
match = exp.match(bug)
@ -662,7 +668,7 @@ def proc_hierarchy(hierarchy):
# Copy & paste from handle_bts_query()
bugs = []
exp = re.compile(r'\#(\d+):')
exp = re.compile(r'\#(\d+)[ :]')
for entry in hierarchy or []:
for bug in entry[1]:
match = exp.match(bug)
@ -690,6 +696,7 @@ def search_bugs(hierarchyfull, bts, queryonly, mirrors,
return "FilterEnd"
count, bugs = proc_hierarchy(hierarchy)
exp = re.compile(r'\#(\d+):')
if not count:
our_raw_input('No match found, press ENTER to continue.')
@ -862,7 +869,7 @@ def display_report(text, use_pager=True):
except IOError:
pass
def spawn_editor(message, filename, editor):
def spawn_editor(message, filename, editor, charset='utf-8'):
if not editor:
ewrite('No editor found!\n')
return (message, 0)
@ -910,7 +917,7 @@ def spawn_editor(message, filename, editor):
if '&' in editor: return (None, 1)
newmessage = file(filename).read()
newmessage = file(filename).read().decode(charset, 'replace')
if newmessage == message:
ewrite('No changes were made in the editor.\n')

80
reportbug_ui_urwid.py

@ -22,7 +22,7 @@
# (LGPL) Version 2.1 or later. On Debian systems, this license is available
# in /usr/share/common-licenses/LGPL
#
# $Id: reportbug_ui_urwid.py,v 1.5 2006-08-18 22:49:21 lawrencc Exp $
# $Id: reportbug_ui_urwid.py,v 1.6 2006-08-25 01:33:40 lawrencc Exp $
import commands, string, sys, re
@ -37,20 +37,10 @@ import reportbug
from reportbug_exceptions import *
from urlutils import launch_browser
from types import StringTypes
ISATTY = sys.stdin.isatty()
from reportbug_ui_text import spawn_editor
def ewrite(message, *args):
if not ISATTY:
return
if args:
sys.stderr.write(message % args)
else:
sys.stderr.write(message)
from reportbug_ui_text import spawn_editor, ewrite
log_message = ewrite
display_failure = ewrite
@ -59,6 +49,8 @@ display_failure = ewrite
def initialize_urwid_ui():
ui = urwid.raw_display.Screen()
ui.register_palette(palette)
# Improve responsiveness of UI
ui.set_input_timeouts(max_wait=0.1)
return ui
# Empty function to satisfy ui.run_wrapper()
@ -140,7 +132,7 @@ class dialog(object):
self.buttons = urwid.Frame(urwid.AttrWrap(box, 'selectable'))
self.frame.footer = urwid.BoxAdapter(self.buttons, min(len(l), 10))
else:
self.buttons = urwid.GridFlow(l, 10, 3, 1, 'center')
self.buttons = urwid.GridFlow(l, 12, 3, 1, 'center')
self.buttons.set_focus(default or 0)
self.frame.footer = urwid.Pile( [ urwid.Divider(), self.buttons ],
focus_item = 1 )
@ -344,7 +336,7 @@ def select_options(msg, ok, help=None, allow_numbers=False, nowrap=False,
return result
def yes_no(msg, yeshelp, nohelp, default=True, nowrap=False, ui=None):
box = dialog(msg, title=reportbug.VERSION)
box = dialog('', long_message=msg, title=reportbug.VERSION)
box.add_buttons([ ('Yes', True), ('No', False) ], default=1-int(default))
result = box.main(ui)
return result
@ -375,7 +367,8 @@ def get_multiline(prompt, options=None, title=None, force_prompt=False,
return l
def menu(par, options, prompt, default=None, title=None, any_ok=False,
order=None, extras=None, multiple=False, empty_ok=False, ui=None):
order=None, extras=None, multiple=False, empty_ok=False, ui=None,
oklabel='Ok', cancellabel='Cancel', quitlabel=None):
selected = {}
if not extras:
@ -424,10 +417,14 @@ def menu(par, options, prompt, default=None, title=None, any_ok=False,
desc or '') for (option, desc) in options]
box = checklistdialog(par, widgets, height=('relative', 80),
title=title)
box.add_buttons( [('Ok', 0), ('Cancel', -1)] )
if quitlabel:
box.add_buttons( [(oklabel, 0), (cancellabel, -1),
(quitlabel, -2)] )
else:
box.add_buttons( [(oklabel, 0), (cancellabel, -1)] )
result, chosen = box.main(ui)
if result == -1:
return None
if result < 0:
return result
return chosen
# Single menu option only
@ -458,7 +455,10 @@ def menu(par, options, prompt, default=None, title=None, any_ok=False,
box = listdialog(par, widgets, height=('relative', 80),
title=title)
box.add_buttons( [('Ok', 0), ('Cancel', -1)] )
if quitlabel:
box.add_buttons( [(oklabel, 0), (cancellabel, -1), (quitlabel, -2)] )
else:
box.add_buttons( [(oklabel, 0), (cancellabel, -1)] )
focus = 0
if default:
for i, opt in enumerate(options):
@ -467,8 +467,8 @@ def menu(par, options, prompt, default=None, title=None, any_ok=False,
break
result, chosen = box.main(ui)
if result == -1:
return None
if result < 0:
return result
return chosen
@ -524,8 +524,8 @@ def show_report(number, system, mirrors,
return
def handle_bts_query(package, bts, mirrors=None, http_proxy="",
queryonly=0, screen=None, title="", archived='no',
source=0):
queryonly=False, screen=None, title="", archived='no',
source=False, version=None):
import debianbts
sysinfo = debianbts.SYSTEMS[bts]
@ -539,7 +539,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
if not ui:
ui = initialize_urwid_ui()
if isinstance(package, StringTypes):
if isinstance(package, basestring):
pkgname = package
if source:
pkgname += ' (source)'
@ -555,7 +555,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
result = None
try:
(count, sectitle, hierarchy) = debianbts.get_reports(
package, bts, mirrors=mirrors,
package, bts, mirrors=mirrors, version=version,
http_proxy=http_proxy, archived=archived, source=source)
if not count:
@ -575,7 +575,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
bcount = len(bugs)
buglist.append( ('---', t) )
for bug in bugs:
bits = bug[1:].split(':', 1)
bits = bug[1:].split('[: ]', 1)
tag, info = bits
info = info.strip()
if not info:
@ -584,11 +584,25 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
p = buglist[1][0]
#scr.popWindow()
if queryonly:
cancellabel = 'Exit'
quitlabel = None
else:
cancellabel = 'Continue'
quitlabel='Quit'
while True:
info = menu('Select a bug to read the report:', buglist,
'', ui=ui, title=sectitle, default=p)
'', ui=ui, title=sectitle, default=p,
oklabel='Get info',
cancellabel=cancellabel,
quitlabel=quitlabel)
ui = None
if not info:
if info < 0:
if info == -1:
result = None
else:
result = info
break
else:
p = info
@ -599,10 +613,16 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
break
except (IOError, NoNetwork):
long_message('Unable to connect to %s BTS.', sysinfo['name'], ui=ui,
ui.run_wrapper(nullfunc)
long_message('Unable to connect to %s BTS.', sysinfo['name'],
title=title)
except NoPackage:
long_message('No record of this package found.', ui=ui, title=title)
ui.run_wrapper(nullfunc)
long_message('No record of this package found.', title=title)
raise NoPackage
if result and result < 0:
raise NoReport
return result

Loading…
Cancel
Save