[Collab-qa-commits] r2114 - udd/web/cgi-bin

Luca Falavigna dktrkranz at alioth.debian.org
Tue Dec 27 23:19:49 UTC 2011


Author: dktrkranz
Date: 2011-12-27 23:19:49 +0000 (Tue, 27 Dec 2011)
New Revision: 2114

Modified:
   udd/web/cgi-bin/python_bugs.cgi
Log:
python_bugs.cgi: use DISTINCT to omit duplicate entries


Modified: udd/web/cgi-bin/python_bugs.cgi
===================================================================
--- udd/web/cgi-bin/python_bugs.cgi	2011-12-27 23:07:30 UTC (rev 2113)
+++ udd/web/cgi-bin/python_bugs.cgi	2011-12-27 23:19:49 UTC (rev 2114)
@@ -1,6 +1,6 @@
-#!/usr/bin/python                                 
+#!/usr/bin/python
 #
-# Copyright (C) 2010 Luca Falavigna <dktrkranz at debian.org>
+# Copyright (C) 2010-2011 Luca Falavigna <dktrkranz at debian.org>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@
 from psycopg2 import connect
 
 query_rc = """
-SELECT all_bugs.id, all_bugs.source, title, severity
+SELECT DISTINCT all_bugs.id, all_bugs.source, title, severity
 FROM all_bugs
 INNER JOIN sources_uniq
 ON sources_uniq.source = all_bugs.source
@@ -34,7 +34,7 @@
 ORDER BY all_bugs.source;"""
 
 query_help = """
-SELECT all_bugs.id, all_bugs.source, title, severity
+SELECT DISTINCT all_bugs.id, all_bugs.source, title, severity
 FROM all_bugs
 INNER JOIN sources_uniq
 ON sources_uniq.source = all_bugs.source
@@ -50,7 +50,7 @@
 ORDER BY all_bugs.source;"""
 
 query_usertag = """
-SELECT all_bugs.id, all_bugs.source, title, severity
+SELECT DISTINCT all_bugs.id, all_bugs.source, title, severity
 FROM all_bugs
 INNER JOIN sources_uniq
 ON sources_uniq.source = all_bugs.source
@@ -80,19 +80,61 @@
 cur.close()
 conn.close()
 
-print 'Content-Type: text/html\n\n'
-print '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'
-print '<html>\n<head>\n<title>Bugs for DPMT/PAPT packages</title>\n<meta http-equiv="Content-Type" content="text/html;charset=utf-8">\n</head>\n<body>'
-print '<h1>Release Critical bugs</h1>'
-print '<table>\n<tr>\n<td><b>ID</b></td>\n<td><b>Package</b></td>\n<td><b>Title</b></td>\n<td><b>Severity</b></td>\n</tr>'
+print '''Content-Type: text/html\n\n
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+"http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<title>Bugs for DPMT/PAPT packages</title>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+</head>
+<body>
+<h1>Release Critical bugs</h1>
+<table>
+<tr>
+<td><b>ID</b></td>
+<td><b>Package</b></td>
+<td><b>Title</b></td>
+<td><b>Severity</b></td>
+</tr>'''
 for d in rc:
-    print '<tr>\n<td><a href="http://bugs.debian.org/%s">#%s</a></td>\n<td>%s</td>\n<td>%s</td>\n<td>%s</td>\n</tr>' % (d[0], d[0], d[1], d[2], d[3])
-print '</table>\n<h1>Bugs needing help</h1>'
-print '<table>\n<tr>\n<td><b>ID</b></td>\n<td><b>Package</b></td>\n<td><b>Title</b></td>\n<td><b>Severity</b></td>\n</tr>'
+    print '''<tr>
+<td><a href="http://bugs.debian.org/%s">#%s</a></td>
+<td>%s</td>
+<td>%s</td>
+<td>%s</td>
+</tr>''' % (d[0], d[0], d[1], d[2], d[3])
+print '''</table>
+<h1>Bugs needing help</h1>'''
+print '''<table>
+<tr><td><b>ID</b></td>
+<td><b>Package</b></td>
+<td><b>Title</b></td>
+<td><b>Severity</b></td>
+</tr>'''
 for d in help:
-    print '<tr>\n<td><a href="http://bugs.debian.org/%s">#%s</a></td>\n<td>%s</td>\n<td>%s</td>\n<td>%s</td>\n</tr>' % (d[0], d[0], d[1], d[2], d[3])
-print '</table>\n<h1>Bugs with usertag debian-python at lists.debian.org</h1>'
-print '<table>\n<tr>\n<td><b>ID</b></td>\n<td><b>Package</b></td>\n<td><b>Title</b></td>\n<td><b>Severity</b></td>\n</tr>'
+    print '''<tr>
+<td><a href="http://bugs.debian.org/%s">#%s</a></td>
+<td>%s</td>
+<td>%s</td>
+<td>%s</td>
+</tr>''' % (d[0], d[0], d[1], d[2], d[3])
+print '''</table>
+<h1>Bugs with usertag debian-python at lists.debian.org</h1>'''
+print '''<table>
+<tr>
+<td><b>ID</b></td>
+<td><b>Package</b></td>
+<td><b>Title</b></td>
+<td><b>Severity</b></td>
+</tr>'''
 for d in usertag:
-    print '<tr>\n<td><a href="http://bugs.debian.org/%s">#%s</a></td>\n<td>%s</td>\n<td>%s</td>\n<td>%s</td>\n</tr>' % (d[0], d[0], d[1], d[2], d[3])
-print'</table>\n</body>\n</html>'
+    print '''<tr>
+<td><a href="http://bugs.debian.org/%s">#%s</a></td>
+<td>%s</td>
+<td>%s</td>
+<td>%s</td>
+</tr>''' % (d[0], d[0], d[1], d[2], d[3])
+print '''</table>
+</body>
+</html>'''




More information about the Collab-qa-commits mailing list