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

Ole Streicher olebole at debian.org
Tue Mar 8 20:50:02 UTC 2016


The following commit has been merged in the master branch:
commit d93891e96d77061a488c8fe646691ccf4ee0c85e
Author: Ole Streicher <olebole at debian.org>
Date:   Tue Mar 8 21:41:12 2016 +0100

    Set indentation to 4 spaces in thermometer.py

diff --git a/webtools/thermometer.py b/webtools/thermometer.py
index 5f7705f..e96ae8a 100755
--- a/webtools/thermometer.py
+++ b/webtools/thermometer.py
@@ -27,22 +27,22 @@ from blendstasktools import ReadConfig, RowDictionaries, CheckOrCreateOutputDir,
 ###########################################################################################
 # Define several prepared statements to query UDD
 try:
-  conn = psycopg2.connect(host="localhost",port=PORT,user="guest",database="udd")
+    conn = psycopg2.connect(host="localhost",port=PORT,user="guest",database="udd")
 except psycopg2.OperationalError, err:
-  try:
-    conn = psycopg2.connect("service=udd")
-  except psycopg2.OperationalError, err:
-    # logger not known at this state: logger.warning
-    stderr.write("Service=udd seems not to be installed on this host.\tMessage: %s\n" % (str(err)))
     try:
-        conn = psycopg2.connect(host="localhost",port=DEFAULTPORT,user="guest",database="udd")
-    except psycopg2.OperationalError:
-        # Hmmm, I observed a really strange behaviour on one of my
-        # machines where connecting to localhost does not work but
-        # 127.0.0.1 works fine.  No idea why ... but this should do
-        # the trick for the moment
-        conn = psycopg2.connect(host="127.0.0.1", port=DEFAULTPORT, user="guest",
-                                database="udd")
+        conn = psycopg2.connect("service=udd")
+    except psycopg2.OperationalError, err:
+        # logger not known at this state: logger.warning
+        stderr.write("Service=udd seems not to be installed on this host.\tMessage: %s\n" % (str(err)))
+        try:
+            conn = psycopg2.connect(host="localhost",port=DEFAULTPORT,user="guest",database="udd")
+        except psycopg2.OperationalError:
+            # Hmmm, I observed a really strange behaviour on one of my
+            # machines where connecting to localhost does not work but
+            # 127.0.0.1 works fine.  No idea why ... but this should do
+            # the trick for the moment
+            conn = psycopg2.connect(host="127.0.0.1", port=DEFAULTPORT, user="guest",
+                                    database="udd")
 
 curs = conn.cursor()
 # uddlog = open('logs/uddquery.log', 'w')
@@ -351,7 +351,7 @@ def main():
     
     outputdir = CheckOrCreateOutputDir(config['outputdir'],'thermometer')
     if outputdir == None:
-            exit(-1)
+        exit(-1)
     
     t = datetime.now()
     
@@ -373,16 +373,16 @@ def main():
         data['projectadvertising'] = None
 
     legend = [
-               ['upToDate',        'Up to date'],
-               ['debianOutOfDate', 'Debian stable behind unstable'],
-               ['ubuntuOutOfDate', 'Ubuntu behind Debian unstable'],
-               ['new',             'Waiting in NEW'],
-               ['unpackaged',      'Not packaged'],
-               ['obsolete',        'Obsolete'],
-               ['newer-in-debian', 'Upstream behind unstable'],
-               ['uptodate',        'Unstable fits upstream'],
-               ['outdated',        'Unstable behind upstream'],
-             ]
+        ['upToDate',        'Up to date'],
+        ['debianOutOfDate', 'Debian stable behind unstable'],
+        ['ubuntuOutOfDate', 'Ubuntu behind Debian unstable'],
+        ['new',             'Waiting in NEW'],
+        ['unpackaged',      'Not packaged'],
+        ['obsolete',        'Obsolete'],
+        ['newer-in-debian', 'Upstream behind unstable'],
+        ['uptodate',        'Unstable fits upstream'],
+        ['outdated',        'Unstable behind upstream'],
+    ]
 
     ulegend = legend[:]
     ulegend.remove(['new', 'Waiting in NEW'])
@@ -397,7 +397,7 @@ def main():
     data['idxsummary']        = _("""A %sDebian Pure Blend%s is a Debian internal project which assembles
 a set of packages that might help users to solve certain tasks of their work.  The list on
 the right shows the tasks of %s.""" ) \
-                                      % ('<a href="http://blends.alioth.debian.org/blends/">', '</a>', data['projectname'])
+        % ('<a href="http://blends.alioth.debian.org/blends/">', '</a>', data['projectname'])
     data['idxsummary']        = Markup(data['idxsummary'])
 
     for key in ('homepage', 'projecturl', 'projectname', 'logourl', 'ubuntuhome', 'projectubuntu'):
@@ -412,17 +412,17 @@ the right shows the tasks of %s.""" ) \
 
     template = loader.load('thermometer.xhtml')
     with codecs.open(outputfile, 'w', 'utf-8') as f:
-      try:
-        f.write(template.generate(**data).render('xhtml'))
-      except TypeError, err:
-        stderr.write("Problem creating thermometer.html.\tMessage: %s\n" % (str(err)))
+        try:
+            f.write(template.generate(**data).render('xhtml'))
+        except TypeError, err:
+            stderr.write("Problem creating thermometer.html.\tMessage: %s\n" % (str(err)))
     SetFilePermissions(outputfile)
     utemplate = loader.load('uthermometer.xhtml')
     with codecs.open(uoutputfile, 'w', 'utf-8') as f:
-      try:
-        f.write(utemplate.generate(**data).render('xhtml'))
-      except TypeError, err:
-        stderr.write("Problem creating uthermometer.html.\tMessage: %s\n" % (str(err)))
+        try:
+            f.write(utemplate.generate(**data).render('xhtml'))
+        except TypeError, err:
+            stderr.write("Problem creating uthermometer.html.\tMessage: %s\n" % (str(err)))
     SetFilePermissions(uoutputfile)
 
 if __name__ == '__main__':

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list