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

Andreas Tille tille at debian.org
Wed Jul 10 09:05:18 UTC 2013


The following commit has been merged in the master branch:
commit 9e167386b8c68437a9b046378f5e20062292f8ed
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jul 10 11:08:19 2013 +0200

    Use proper markup in project advertising

diff --git a/webtools/templates/thermometer.xhtml b/webtools/templates/thermometer.xhtml
index c0d6283..51b8f38 100644
--- a/webtools/templates/thermometer.xhtml
+++ b/webtools/templates/thermometer.xhtml
@@ -70,8 +70,8 @@ table.pkg tr.othered {
      </span>
 </a>
 </div>
-<div class="heading" py:if="advertising">
-    <div class="tabBar" style="text-align: center;">$advertising</div>
+<div class="heading" py:if="projectadvertising">
+    <div class="tabBar" style="text-align: center;">$projectadvertising</div>
 </div>
 <table class="pkg">
 <caption><h3>$projectname Package Thermometer</h3></caption>
diff --git a/webtools/thermometer.py b/webtools/thermometer.py
index 88d2186..5782897 100755
--- a/webtools/thermometer.py
+++ b/webtools/thermometer.py
@@ -20,6 +20,7 @@ from genshi.template import TemplateLoader
 from genshi import Markup
 from genshi.template.eval import UndefinedError
 
+from blendsunicode   import to_unicode
 from blendstasktools import ReadConfig, RowDictionaries, CheckOrCreateOutputDir
 
 ###########################################################################################
@@ -288,6 +289,14 @@ def main():
     data={}
     data['projectname'] = blendname
     data['blend_data']  = blend_data
+    if config.has_key('advertising'):
+        # we have to remove the gettext _() call which was inserted into the config
+        # file to enable easy input for config file editors - but the call has to
+        # be made explicitely in the python code
+        advertising = re.sub('_\(\W(.+)\W\)', '\\1', config['advertising'])
+        # gettext needs to escape '"' thus we need to remove the escape character '\'
+        data['projectadvertising'] = Markup(to_unicode(re.sub('\\\\"', '"', advertising)))
+
     legend = [
                ['upToDate',        'Up to date'],
                ['debianOutOfDate', 'Debian stable behind unstable'],

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list