[Reportbug-maint] Bug#166168: to launch a browser on the BTS page
Carl Chenet
chaica at ohmytux.com
Sat Aug 1 14:57:24 UTC 2009
Package: reportbug
Version: 4.5
Severity: normal
Tags: patch
Here is a patch to do so, allowing to press "b" in the menu, opening the bug list in the default sensible-browser.
Bye,
Carl Chenet
-- Package-specific info:
** Environment settings:
DEBEMAIL="chaica at ohmytux.com"
DEBFULLNAME="Carl Chenet"
INTERFACE="text"
** /home/chaica/.reportbugrc:
reportbug_version "4.5"
mode novice
ui text
smtphost "smtp.free.fr"
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: i386 (i686)
Kernel: Linux 2.6.26-1-686 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages reportbug depends on:
ii apt 0.7.21 Advanced front-end for dpkg
ii python 2.5.4-2 An interactive high-level object-o
ii python-reportbug 4.5 Python modules for interacting wit
reportbug recommends no packages.
Versions of packages reportbug suggests:
pn debconf-utils <none> (no description available)
ii debsums 2.0.44 verification of installed package
pn dlocate <none> (no description available)
ii exim4 4.69-9 metapackage to ease Exim MTA (v4)
ii exim4-daemon-light [mail-tran 4.69-9 lightweight Exim MTA (v4) daemon
ii file 5.00-1 Determines file type using "magic"
ii gnupg 1.4.9-4 GNU privacy guard - a free PGP rep
pn python-gnome2-extras <none> (no description available)
pn python-gtk2 <none> (no description available)
pn python-urwid <none> (no description available)
pn python-vte <none> (no description available)
-- no debconf information
-------------- next part --------------
>From 874618b111de6c7a5cfbe7d30c480871e32a85e5 Mon Sep 17 00:00:00 2001
From: chaica <chaica at ohmytux.com>
Date: Sat, 1 Aug 2009 16:11:32 +0200
Subject: [PATCH] allow browsing bug list through web browser
---
reportbug/ui/text_ui.py | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/reportbug/ui/text_ui.py b/reportbug/ui/text_ui.py
index 450d7c3..1ebcec4 100644
--- a/reportbug/ui/text_ui.py
+++ b/reportbug/ui/text_ui.py
@@ -559,7 +559,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
ewrite('%d bug reports found:\n\n', count)
return browse_bugs(hierarchy, count, bugs, bts, queryonly,
- mirrors, http_proxy, screen, title)
+ mirrors, http_proxy, screen, title, package)
except (IOError, NoNetwork):
ewrite('Unable to connect to %s BTS; ', debianbts.SYSTEMS[bts]['name'])
@@ -570,7 +570,7 @@ def handle_bts_query(package, bts, mirrors=None, http_proxy="",
raise NoNetwork
def browse_bugs(hierarchy, count, bugs, bts, queryonly, mirrors,
- http_proxy, screen, title):
+ http_proxy, screen, title, package):
try:
output_encoding = locale.getpreferredencoding()
except locale.Error, msg:
@@ -615,8 +615,8 @@ def browse_bugs(hierarchy, count, bugs, bts, queryonly, mirrors,
if endcount == count:
skipmsg = ''
- options = 'yNmrqsf'
- if queryonly: options = 'Nmrqf'
+ options = 'yNbmrqsf'
+ if queryonly: options = 'Nbmrqf'
rstr = "(%d-%d/%d) " % (startcount, endcount, count)
pstr = rstr + "Is the bug you found listed above"
@@ -628,6 +628,7 @@ def browse_bugs(hierarchy, count, bugs, bts, queryonly, mirrors,
'add extra information.',
'n' : 'Problem not listed above; possibly '
'check more.',
+ 'b' : 'Open the complete bug list in your web browser.',
'm' : 'Get more information about a bug (you '
'can also enter a number\n'
' without selecting "m" first).',
@@ -647,6 +648,9 @@ def browse_bugs(hierarchy, count, bugs, bts, queryonly, mirrors,
if x == 'n':
lastpage = []
break
+ elif x == 'b':
+ launch_browser('http://bugs.debian.org/%s' % package)
+ continue
elif x == 'r':
continue
elif x == 'q':
@@ -680,7 +684,7 @@ def browse_bugs(hierarchy, count, bugs, bts, queryonly, mirrors,
elif x == 'f':
# Do filter. Recursive done.
retval = search_bugs(hierarchy,bts, queryonly, mirrors,
- http_proxy, screen, title)
+ http_proxy, screen, title, package)
if retval in ["FilterEnd", "Top"]:
continue
else:
@@ -749,7 +753,7 @@ def proc_hierarchy(hierarchy):
return count, bugs
def search_bugs(hierarchyfull, bts, queryonly, mirrors,
- http_proxy, screen, title):
+ http_proxy, screen, title, package):
"""Search for the bug list using a pattern."""
"""Return string "FilterEnd" when we are done with search."""
@@ -813,8 +817,8 @@ def search_bugs(hierarchyfull, bts, queryonly, mirrors,
if endcount == count:
skipmsg = ''
- options = 'yNmrqsfut'
- if queryonly: options = 'Nmrqfut'
+ options = 'yNbmrqsfut'
+ if queryonly: options = 'Nmbrqfut'
rstr = "(%d-%d/%d) " % (startcount, endcount, count)
pstr = rstr + "Is the bug you found listed above"
@@ -826,6 +830,7 @@ def search_bugs(hierarchyfull, bts, queryonly, mirrors,
'add extra information.',
'n' : 'Problem not listed above; possibly '
'check more.',
+ 'b' : 'Open the complete bug list in your web browser.',
'm' : 'Get more information about a bug (you '
'can also enter a number\n'
' without selecting "m" first).',
@@ -846,6 +851,8 @@ def search_bugs(hierarchyfull, bts, queryonly, mirrors,
if x == 'n':
lastpage = []
break
+ elif x == 'b':
+ launch_browser('http://bugs.debian.org/%s' % package)
elif x == 'r':
continue
elif x == 'q':
--
1.6.2.3
More information about the Reportbug-maint
mailing list