[Blends-commit] [SCM] website branch, master, updated. 9e167386b8c68437a9b046378f5e20062292f8ed
Andreas Tille
tille at debian.org
Wed Jul 10 09:05:17 UTC 2013
The following commit has been merged in the master branch:
commit 0e9ee2023a8b5f488c7ecad466f395d02632652a
Author: Andreas Tille <tille at debian.org>
Date: Mon Jul 8 19:45:08 2013 +0200
Use common code from blendstaskstools
diff --git a/webtools/thermometer.py b/webtools/thermometer.py
index a5c7adb..73d4b85 100755
--- a/webtools/thermometer.py
+++ b/webtools/thermometer.py
@@ -20,6 +20,8 @@ from genshi.template import TemplateLoader
from genshi import Markup
from genshi.template.eval import UndefinedError
+from blendstasktools import ReadConfig, RowDictionaries
+
###########################################################################################
# Define several prepared statements to query UDD
try:
@@ -51,29 +53,6 @@ def _execute_udd_query(query):
except psycopg2.DataError, err:
print >>stderr, "%s; query was\n%s" % (err, query)
-def RowDictionaries(cursor):
- """Return a list of dictionaries which specify the values by their column names"""
-
- description = cursor.description
- if not description:
- # even if there are no data sets to return the description should contain the table structure. If not something went
- # wrong and we return NULL as to represent a problem
- return NULL
- if cursor.rowcount <= 0:
- # if there are no rows in the cursor we return an empty list
- return []
-
- data = cursor.fetchall()
- result = []
-
- for row in data:
- resultrow = {}
- i = 0
- for dd in description:
- resultrow[dd[0]] = row[i]
- i += 1
- result.append(resultrow)
- return result
def main():
@@ -82,6 +61,7 @@ def main():
exit(-1)
blendname = argv[1]
+ config = ReadConfig(blendname)
query = """PREPARE query_thermometer (text) AS
SELECT b.source,
--
Static and dynamic websites for Debian Pure Blends
More information about the Blends-commit
mailing list