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

Andreas Tille tille at debian.org
Sat Jul 6 19:10:13 UTC 2013


The following commit has been merged in the master branch:
commit 2921f679368f646855f76ce1c1b5307f6374f0b2
Author: Andreas Tille <tille at debian.org>
Date:   Sat Jul 6 19:25:49 2013 +0200

    Enable specifying Blendname

diff --git a/misc/thermometer/thermometer.py b/misc/thermometer/thermometer.py
index 06c3a6a..3f32a72 100755
--- a/misc/thermometer/thermometer.py
+++ b/misc/thermometer/thermometer.py
@@ -7,7 +7,7 @@ UDDPORT=5452
 PORT=UDDPORT
 DEFAULTPORT=5432
 
-from sys import stderr, exit
+from sys import argv, stderr, exit
 import os
 import psycopg2
 import json
@@ -76,6 +76,13 @@ def RowDictionaries(cursor):
     return result
 
 def main():
+
+    if len(argv) <= 1:
+        print >>stderr, "Usage: %s <Blend name>" % argv[0]
+        exit(-1)
+
+    blendname = argv[1]
+
     query = """PREPARE query_thermometer (text) AS
      SELECT b.source,
            stable.version AS stable,
@@ -231,12 +238,11 @@ def main():
     """
     _execute_udd_query(query)
     
-    blendname = 'debian-med'
     _execute_udd_query( "EXECUTE query_thermometer('%s')" % blendname)
     
     if curs.rowcount > 0:
         blend_data = RowDictionaries(curs)
-        f = open('thermometer.json', 'w')
+        f = open(blendname+'_thermometer.json', 'w')
         print >>f, json.dumps(blend_data)
         f.close()
     else:
@@ -259,7 +265,7 @@ def main():
     t = datetime.now()
     
     template = loader.load('thermometer.xhtml')
-    outputfile = outputdir + '/thermometer.html'
+    outputfile = outputdir + '/' + blendname + '_thermometer.html'
     try:
         os.unlink(outputfile)
     except: # simply continue if file does not exist

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list