[oe-commits] org.oe.dev contrib/qa/bugzilla.py: Extract all bug reports, even the ones from bugs.openembedded.org

freyther commit openembedded-commits at lists.openembedded.org
Fri Mar 16 21:11:23 UTC 2007


contrib/qa/bugzilla.py: Extract all bug reports, even the ones from bugs.openembedded.org

    Abuse the class attribute even further and check for severities. We are
    able to find all 2006 bugs of OpenEmbedded and all 282 bugs of OpenMoko

Author: freyther at openembedded.org
Branch: org.openembedded.dev
Revision: 2a553ef001450b9076d93d67102518bb6c34bcf7
ViewMTN: http://monotone.openembedded.org/revision.psp?id=2a553ef001450b9076d93d67102518bb6c34bcf7
Files:
1
contrib/qa/bugzilla.py
Diffs:

#
# mt diff -rb9293118c194a01c44b71ffff72e461a3fe86807 -r2a553ef001450b9076d93d67102518bb6c34bcf7
#
# 
# 
# patch "contrib/qa/bugzilla.py"
#  from [9e2793fb6ab56eae55995f015b0e84647b928bc6]
#    to [9bf749e3495c7360334ab2743f1aeee6896d6a22]
# 
============================================================
--- contrib/qa/bugzilla.py	9e2793fb6ab56eae55995f015b0e84647b928bc6
+++ contrib/qa/bugzilla.py	9bf749e3495c7360334ab2743f1aeee6896d6a22
@@ -25,11 +25,16 @@ class BugQueryExtractor(HTMLParser):
     def __init__(self):
         HTMLParser.__init__(self)
         self.state = self.STATE_NONE
+        self.bug  = None
         self.bugs = []
 
     def handle_starttag(self, tag, attr):
         if self.state == self.STATE_NONE and tag.lower() == "tr":
-            if len(attr) == 1 and attr[0] == ('class', 'bz_normal bz_P2 '):
+            # check for bz_normal and bz_P2 as indicator in buglist.cgi
+            # use 'all' and 'map' on python2.5
+            if len(attr) == 1 and attr[0][0] == 'class' and \
+               ('bz_normal' in attr[0][1] or 'bz_blocker' in attr[0][1] or 'bz_enhancement' in attr[0][1] or 'bz_major' in attr[0][1] or 'bz_minor' in attr[0][1] or 'bz_trivial' in attr[0][1] or 'bz_critical' in attr[0][1] or 'bz_wishlist' in attr[0][1]) \
+               and 'bz_P' in attr[0][1]:
                 print "Found tr %s %s" % (tag, attr)
                 self.state = self.STATE_FOUND_TR
         elif self.state == self.STATE_FOUND_TR and tag.lower() == "td":
@@ -41,6 +46,7 @@ class BugQueryExtractor(HTMLParser):
             if self.state != self.STATE_NONE:
                 self.bugs.append( (self.bug,self.status) )
             self.state = self.STATE_NONE
+            self.bug = None
         if self.state > 1 and tag.lower() == "td":
             print "Next TD"
             self.state += 1
@@ -51,11 +57,17 @@ class BugQueryExtractor(HTMLParser):
         # skip garbage
         if len(data) == 0:
             return
-    
+
         if self.state == self.STATE_FOUND_NUMBER:
+            """
+            #1995 in bugs.oe.org has [SEC] additionally to the number and we want to ignore it
+            """
             print "Bug Number '%s'" % data.strip()
+            if self.bug:
+                print "Ignoring bug data"
+                return
             self.bug = data
-           
+
         elif self.state == self.STATE_FOUND_STATUS:
             print "Status Name '%s'" % data.strip()
             self.status = data
@@ -65,7 +77,7 @@ class BugQueryExtractor(HTMLParser):
         return self.bugs
 
 #
-site = """<!-- 1.0 at bugzilla.org -->
+bugs_openmoko = """<!-- 1.0 at bugzilla.org -->
 
 
 
@@ -108,266 +120,6 @@ site = """<!-- 1.0 at bugzilla.org -->
 
 
 
-        <div id="header">
-                <a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/" id="site_logo"><img src="/style/images/openmoko_logo.png" alt="openmoko.org" /></a>
-                
-                <div id="main_navigation">
-                        <ul>
-                                <li><a href="http://www.openmoko.org/" class="nav_home"><span>Home</span></a></li>
-                                <li><a href="http://wiki.openmoko.org/" class="nav_wiki"><span>Wiki</span></a></li>
-                                <li><a href="http://bugzilla.openmoko.org/" class="nav_bugzilla selected"><span>Bugzilla</span></a></li>
-                                <li><a href="http://planet.openmoko.org/" class="nav_planet"><span>Planet</span></a></li>
-                                <li><a href="http://projects.openmoko.org/" class="nav_projects"><span>Projects</span></a></li>
-                                <li><a href="http://lists.openmoko.org/" class="nav_lists"><span>Lists</span></a></li>
-                        </ul>
-                </div>
-        </div>
-
-        <div class="page_title">
-                <strong>Bug List</strong> 
-        </div>
-    
- <div class="container">
-
-<div align="center">
-  <b>Tue Mar  6 19:01:13 CET 2007</b><br>
-
-
-    <a href="quips.cgi"><i>Free your problems
-</i></a>
-
-</div>
-
-
-<hr>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-<!-- 1.0 at bugzilla.org -->
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-  
-  <table class="bz_buglist" cellspacing="0" cellpadding="4" width="100%">
-    <colgroup>
-      <col class="bz_id_column">
-      <col class="bz_severity_column">
-      <col class="bz_priority_column">
-      <col class="bz_platform_column">
-      <col class="bz_owner_column">
-      <col class="bz_status_column">
-      <col class="bz_resolution_column">
-      <col class="bz_summary_column">
-    </colgroup>
-
-    <tr align="left">
-      <th colspan="1">
-        <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.bug_id">ID</a>
-      </th>
-
-<th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.bug_severity,bugs.bug_id">Sev</a>
-  </th><th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.priority,bugs.bug_id">Pri</a>
-  </th><th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.rep_platform,bugs.bug_id">Plt</a>
-  </th><th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=map_assigned_to.login_name,bugs.bug_id">Owner</a>
-  </th><th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.bug_status,bugs.bug_id">State</a>
-  </th><th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.resolution,bugs.bug_id">Result</a>
-  </th><th colspan="1">
-    <a href="buglist.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds&amp;order=bugs.short_desc,bugs.bug_id">Summary</a>
-  </th>
-
-
-    </tr>
-
-  <tr class="bz_normal bz_P2 ">
-
-    <td>
-      <a href="show_bug.cgi?id=238">238</a>
-    </td>
-
-    <td><nobr>nor</nobr>
-    </td>
-    <td><nobr>P2</nobr>
-    </td>
-    <td><nobr>Mac</nobr>
-    </td>
-    <td><nobr>mickey at vanille-media.de</nobr>
-    </td>
-    <td><nobr>NEW</nobr>
-    </td>
-    <td><nobr></nobr>
-    </td>
-    <td>manual test bug
-    </td>
-
-  </tr>
-
-  
-    </table>
-
-
-
-
-
-  One bug found.
-
-
-<br>
-
-
-
-
-
-
-
-
-
-
-
-
-  <form method="post" action="long_list.cgi">
-    <input type="hidden" name="buglist" value="238">
-    <input type="submit" value="Long Format">
-
-    <a href="query.cgi">Query Page</a> &nbsp;&nbsp;
-    <a href="enter_bug.cgi">Enter New Bug</a> &nbsp;&nbsp;
-    <a href="colchange.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds">Change Columns</a> &nbsp;&nbsp;
-
-
-
-    <a href="query.cgi?short_desc_type=substring&amp;short_desc=manual+test+bug&amp;product=OpenMoko&amp;component=autobuilds">Edit this Query</a> &nbsp;&nbsp;
-
-  </form>
-
-
-
-
-
-
-<!-- 1.0 at bugzilla.org -->
-
-
-
-  
-
-  
-</div>
-
-<div class="footer">
-        <div class="group">This is <b>Bugzilla</b>: the Mozilla bug system.  For more information about what Bugzilla is and what it can do, see <a href="http://www.bugzilla.org/">bugzilla.org</a>.</div>
-        <!-- 1.0 at bugzilla.org -->
-
-
-
-
-
-
-<form method="get" action="show_bug.cgi">
-        <div class="group">
-                <a href="enter_bug.cgi">New</a> | <a href="query.cgi">Query</a> | <input type="submit" value="Find"> bug # <input name="id" size="6"> | <a href="reports.cgi">Reports</a> | <a href="votes.cgi?action=show_user">My Votes</a> 
-        </div>
- 
-        <div class="group">
-        Edit <a href="userprefs.cgi">prefs</a> 
-        | <a href="relogin.cgi">Log&nbsp;out</a>&nbsp;&nbsp;freyther at yahoo.com
-        </div>
-
-    
-    
-      
-    <div class="group">
-                  Preset&nbsp;Queries:
-
-          <a href="buglist.cgi?bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;email1=freyther%40yahoo.com&amp;emailtype1=exact&amp;emailassigned_to1=1&amp;emailreporter1=1">My&nbsp;Bugs</a>
-
-    </div>
-</form>
-</div>  
-
-</body>
-</html>
-"""
-
-all_bugs = """<!-- 1.0 at bugzilla.org -->
-
-
-
-
-
-
-
-
-
-
-
-<!-- 1.0 at bugzilla.org -->
-
-
-
-
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<html>
-  <head>
-    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-    <title>Bug List</title>
-
-
-    
-    
-    
-    <link href="/style/style.css" rel="stylesheet" type="text/css" />
-    
-        <link href="/bugzilla/css/buglist.css" rel="stylesheet" type="text/css">
-  
-  </head>
-  
-
-
-  <body bgcolor="#FFFFFF" onload="">
-
-
-<!-- 1.0 at bugzilla.org -->
-
-
-
-
     <div id="header">
         <a href="http://bugzilla.openmoko.org/cgi-bin/bugzilla/" id="site_logo"><img src="/style/images/openmoko_logo.png" alt="openmoko.org" /></a>
         
@@ -390,10 +142,10 @@ all_bugs = """<!-- 1.0 at bugzilla.org -->
  <div class="container">
 
 <div align="center">
-  <b>Tue Mar  6 20:23:16 CET 2007</b><br>
+  <b>Fri Mar 16 20:51:52 CET 2007</b><br>
 
 
-    <a href="quips.cgi"><i>Free your problems
+    <a href="quips.cgi"><i>It was a time of great struggle and heroic deeds
 </i></a>
 
 </div>
@@ -405,7 +157,7 @@ all_bugs = """<!-- 1.0 at bugzilla.org -->
 
 
 
-228 bugs found.
+282 bugs found.
 
 
 
@@ -454,23 +206,23 @@ 228 bugs found.
 
     <tr align="left">
       <th colspan="1">
-        <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.bug_id">ID</a>
+        <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.bug_id">ID</a>
       </th>
 
 <th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.bug_severity,bugs.bug_id">Sev</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.bug_severity,bugs.bug_id">Sev</a>
   </th><th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.priority,bugs.bug_id">Pri</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.priority,bugs.bug_id">Pri</a>
   </th><th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.rep_platform,bugs.bug_id">Plt</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.rep_platform,bugs.bug_id">Plt</a>
   </th><th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=map_assigned_to.login_name,bugs.bug_id">Owner</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=map_assigned_to.login_name,bugs.bug_id">Owner</a>
   </th><th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.bug_status,bugs.bug_id">State</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.bug_status,bugs.bug_id">State</a>
   </th><th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.resolution,bugs.bug_id">Result</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.resolution,bugs.bug_id">Result</a>
   </th><th colspan="1">
-    <a href="buglist.cgi?product=OpenMoko&amp;order=bugs.short_desc,bugs.bug_id">Summary</a>
+    <a href="buglist.cgi?short_desc_type=allwordssubstr&amp;short_desc=&amp;long_desc_type=allwordssubstr&amp;long_desc=&amp;bug_file_loc_type=allwordssubstr&amp;bug_file_loc=&amp;bug_status=UNCONFIRMED&amp;bug_status=NEW&amp;bug_status=ASSIGNED&amp;bug_status=REOPENED&amp;bug_status=RESOLVED&amp;bug_status=VERIFIED&amp;bug_status=CLOSED&amp;emailassigned_to1=1&amp;emailtype1=substring&amp;email1=&amp;emailassigned_to2=1&amp;emailreporter2=1&amp;emailcc2=1&amp;emailtype2=substring&amp;email2=&amp;bugidtype=include&amp;bug_id=&amp;votes=&amp;changedin=&amp;chfieldfrom=&amp;chfieldto=Now&amp;chfieldvalue=&amp;field0-0-0=noop&amp;type0-0-0=noop&amp;value0-0-0=&amp;order=bugs.short_desc,bugs.bug_id">%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list