[Reportbug-commits] r664 - in branches/lenny (2 files)

morph at users.alioth.debian.org morph at users.alioth.debian.org
Wed Nov 12 15:55:00 UTC 2008


    Date: Wednesday, November 12, 2008 @ 15:54:59
  Author: morph
Revision: 664

* reportbuglib/reportbug_ui_text.py
  - added filter for bugs reports, removing all the additional info not
    needed; thanks to Ryo Igarashi for the report; Closes: #504424

Modified:
  branches/lenny/debian/changelog
  branches/lenny/reportbuglib/reportbug_ui_text.py

Modified: branches/lenny/debian/changelog
===================================================================
--- branches/lenny/debian/changelog	2008-11-09 11:50:46 UTC (rev 663)
+++ branches/lenny/debian/changelog	2008-11-12 15:54:59 UTC (rev 664)
@@ -1,3 +1,11 @@
+reportbug (3.47) unstable; urgency=low
+
+  * reportbuglib/reportbug_ui_text.py
+    - added filter for bugs reports, removing all the additional info not
+      needed; thanks to Ryo Igarashi for the report; Closes: #504424
+
+ -- Sandro Tosi <morph at debian.org>  Wed, 12 Nov 2008 16:28:40 +0100
+
 reportbug (3.46) unstable; urgency=low
 
   * debian/control

Modified: branches/lenny/reportbuglib/reportbug_ui_text.py
===================================================================
--- branches/lenny/reportbuglib/reportbug_ui_text.py	2008-11-09 11:50:46 UTC (rev 663)
+++ branches/lenny/reportbuglib/reportbug_ui_text.py	2008-11-12 15:54:59 UTC (rev 664)
@@ -481,6 +481,7 @@
         (count, title, hierarchy)=debianbts.get_reports(
             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) = \
@@ -492,13 +493,28 @@
             for entry in hierarchy2:
                 hierarchy.append( (package2+' '+entry[0], entry[1]) )
 
-        exp = re.compile(r'#(\d+)[ :]')
-        for entry in hierarchy or []:
+        # remove unneeded info from bugs hierarchy, we leave only bug number and subject
+        # format "#<bug no> [???] [pkg name] subject <all the rest>
+        bug_re = re.compile(r'#(\d+) \[[^]]+\] \[[^]]+\] (.*) Reported by.*')
+        hierarchy_new = []
+
+        for entry in hierarchy:
+            # first item is the title of the section
+            entry_new = entry[0]
+            bugs_new = []
+            # second item is a list of bugs report
             for bug in entry[1]:
-                match = exp.match(bug)
+                match = bug_re.match(bug)
                 if match:
+                    # we take the info we need (bug number and subject)
+                    bugs_new.append("#" + match.group(1) + "  " + match.group(2))
+                    # and at the same time create a list of bug number
                     bugs.append(int(match.group(1)))
+            hierarchy_new.append( (entry_new,bugs_new))
 
+        # replace old hierarchy with hierarchy_new
+        hierarchy = hierarchy_new
+
         if not count:
             if hierarchy == None:
                 raise NoPackage




More information about the Reportbug-commits mailing list