[debian-edu-commits] r82992 - in trunk: . alioth alioth/cgi-bin
pere at alioth.debian.org
pere at alioth.debian.org
Fri Jan 24 09:58:00 UTC 2014
Author: pere
Date: 2014-01-24 09:58:00 +0000 (Fri, 24 Jan 2014)
New Revision: 82992
Added:
trunk/alioth/
trunk/alioth/cgi-bin/
trunk/alioth/cgi-bin/edu-debtags.cgi
trunk/alioth/html/
Removed:
trunk/html/
Log:
Add current cgi-bin directory and move html stuff into new alioth/ directory.
Added: trunk/alioth/cgi-bin/edu-debtags.cgi
===================================================================
--- trunk/alioth/cgi-bin/edu-debtags.cgi (rev 0)
+++ trunk/alioth/cgi-bin/edu-debtags.cgi 2014-01-24 09:58:00 UTC (rev 82992)
@@ -0,0 +1,51 @@
+#!/usr/bin/python
+
+from psycopg2 import connect
+from re import split, sub
+
+query = """
+SELECT package, tag from debtags
+ WHERE tag like 'field::%'
+ AND package IN (SELECT package FROM debtags
+ WHERE tag = 'use::learning'
+ AND package IN (SELECT package FROM debtags
+ WHERE tag = 'role::program' and package in (select package from debtags where tag = 'interface::x11'))) order by tag, package;
+"""
+
+conn = connect(database='udd', port=5452, host='udd.debian.org', user='guest')
+cur = conn.cursor()
+cur.execute(query)
+rows = cur.fetchall()
+cur.close()
+conn.close()
+
+print "Content-type: text/html"
+
+print """
+<html>
+<head>
+<title>Debian Edu educational software</title>
+</head>
+<body>
+<h1>Debian Edu educational software</h1>
+
+<p>Packages tagged use::learning, role::program and interface::x11. Please <a href="http://debtags.debian.net/">add debtags</a> if a program are missing in the list, and <a href="http://screenshots.debian.net/">add screenshots</a> if no-one did so already.</p>
+"""
+
+lastfieldtag = None
+for row in rows:
+ (package, fieldtag) = row
+ if lastfieldtag != fieldtag:
+ if lastfieldtag is not None:
+ print "</p>"
+ print "<strong>%s</strong>" % fieldtag
+ print "<p>"
+ lastfieldtag = fieldtag
+ print "<a href=\"http://packages.debian.org/search?searchon=names&exact=1&suite=all§ion=all&keywords=%s\"><img src=\"http://screenshots.debian.net/thumbnail/%s\"></a>" % (package, package)
+if lastfieldtag is not None:
+ print "</p>"
+
+print """
+</body>
+</html>
+"""
Property changes on: trunk/alioth/cgi-bin/edu-debtags.cgi
___________________________________________________________________
Added: svn:executable
+ *
More information about the debian-edu-commits
mailing list