[Blends-commit] [SCM] website branch, master, updated. db85bdd4e9979ded3d1bc71dd76246eb107e023f

Andreas Tille tille at debian.org
Sun May 26 23:13:15 UTC 2013


The following commit has been merged in the master branch:
commit c2121bc4ab7d5e831983b238b9f8e4b8a5d91f22
Author: Andreas Tille <tille at debian.org>
Date:   Sun May 26 23:30:48 2013 +0200

    Use distribution field in table blends_metadata table to exclude non-official stuff; export additional JSON data about output URL

diff --git a/misc/pts/taskinfo-example.py b/misc/pts/taskinfo-example.py
index e974d0e..c245737 100755
--- a/misc/pts/taskinfo-example.py
+++ b/misc/pts/taskinfo-example.py
@@ -10,7 +10,7 @@ DEFAULTPORT=5432
 from sys import stderr, exit
 import psycopg2
 import json
-
+import re
 
 ###########################################################################################
 # Define several prepared statements to query UDD
@@ -67,9 +67,23 @@ def RowDictionaries(cursor):
         result.append(resultrow)
     return result
 
-query = "SELECT blend, task, package, dependency, component FROM blends_dependencies WHERE distribution = 'debian'"
+query = """SELECT d.blend, d.task, t.title, package, dependency, component FROM blends_dependencies d
+             JOIN blends_tasks t ON d.task = t.task
+             JOIN blends_metadata m ON d.blend = m.blend
+             WHERE d.distribution = 'debian' AND m.distribution ilike 'Debian'"""
 _execute_udd_query(query)
 if curs.rowcount > 0:
     data_in_json_format = json.dumps(RowDictionaries(curs))
 
-print data_in_json_format
+f = open('tasksdata.json', 'w')
+print >>f, data_in_json_format
+f.close()
+
+query = "SELECT blend, outputdir FROM blends_metadata WHERE distribution ilike 'Debian'"
+_execute_udd_query(query)
+if curs.rowcount > 0:
+    for row in RowDictionaries(curs):
+	row['outputdir'] = re.sub('/var/lib/gforge/chroot/home/groups/([^/]+)/htdocs(.*)', \
+	                          'http://\\1.alioth.debian.org\\2/tasks/', \
+	                          row['outputdir'])
+	print row

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list