Author: fw
Date: 2006-05-20 17:08:37 +0000 (Sat, 20 May 2006)
New Revision: 4005

Modified:
   bin/tracker_service.py
   lib/python/security_db.py
Log:
* lib/python/security_db.py (DB.getTODOs):
  Add hide_check parameter.

* bin/tracker_service.py (TrackerService.page_status_todo):
  Use it.


Modified: bin/tracker_service.py
===================================================================
--- bin/tracker_service.py      2006-05-20 14:29:28 UTC (rev 4004)
+++ bin/tracker_service.py      2006-05-20 17:08:37 UTC (rev 4005)
@@ -825,12 +825,21 @@
                                  "Remote"))])
 
     def page_status_todo(self, path, params, url):
+        hide_check = params.get('hide_check', False)
+        if hide_check:
+            flags = A(url.updateParamsDict({'hide_check' : None}),
+                      'Show "check" TODOs')
+        else:
+            flags = A(url.updateParamsDict({'hide_check' : '1'}),
+                  'Hide "check" TODOs')
+            
         def gen():
-            for (bug, description) in self.db.getTODOs():
+            for (bug, description) in self.db.getTODOs(hide_check=hide_check):
                 yield self.make_xref(url, bug), description
         return self.create_page(
             url, "Bugs with TODO items",
-            [make_table(gen(),
+            [P(flags),
+             make_table(gen(),
                         caption=("Bug", "Description"))])
 
     def page_status_itp(self, path, params, url):

Modified: lib/python/security_db.py
===================================================================
--- lib/python/security_db.py   2006-05-20 14:29:28 UTC (rev 4004)
+++ lib/python/security_db.py   2006-05-20 17:08:37 UTC (rev 4005)
@@ -1807,15 +1807,25 @@
             AND bugs.name = st.bug_name
             ORDER BY bugs.name""", (pkg,))
 
-    def getTODOs(self, cursor=None):
+    def getTODOs(self, cursor=None, hide_check=False):
         """Returns a list of pairs (BUG-NAME, DESCRIPTION)."""
         if cursor is None:
             cursor = self.cursor()
-        return cursor.execute(
-            """SELECT DISTINCT bugs.name, bugs.description
-            FROM bugs_notes, bugs
-            WHERE bugs_notes.typ = 'TODO' AND bugs.name = bugs_notes.bug_name
-            ORDER BY name """)
+        if hide_check:
+            return cursor.execute(
+                """SELECT DISTINCT bugs.name, bugs.description
+                FROM bugs_notes, bugs
+                WHERE bugs_notes.typ = 'TODO'
+                AND bugs_notes.comment <> 'check'
+                AND bugs.name = bugs_notes.bug_name
+                ORDER BY name """)
+        else:
+            return cursor.execute(
+                """SELECT DISTINCT bugs.name, bugs.description
+                FROM bugs_notes, bugs
+                WHERE bugs_notes.typ = 'TODO'
+                AND bugs.name = bugs_notes.bug_name
+                ORDER BY name """)
 
     def getBugXrefs(self, cursor, bug):
         """Returns a generator for a list of bug names.  The listed


_______________________________________________
Secure-testing-commits mailing list
Secure-testing-commits@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/secure-testing-commits

Reply via email to