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

Andreas Tille tille at debian.org
Wed Jul 10 14:32:58 UTC 2013


The following commit has been merged in the master branch:
commit 540b4dc21eb0d62b2988c01d73fb71fc5d739509
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jul 10 16:35:35 2013 +0200

    Provide links as on original thermometer in left side menu in case ubuntuhome and projectubuntu are set in webconf

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index e49fb20..b4599dd 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -523,6 +523,8 @@ def ReadConfig(blendname=''):
             'outputdir'   : '',
             'datadir'     : '',
             'advertising' : None,  # headline with advertising string is optional
+            'ubuntuhome'  : None,
+            'projectubuntu':None,
           }
     for stanza in deb822.Sources.iter_paragraphs(f, shared_storage=False):    
         ret['Blend']       = stanza['blend']        # short name of the project
@@ -548,6 +550,10 @@ def ReadConfig(blendname=''):
             advertising = re.sub('_\(\W(.+)\W\)', '\\1', stanza['advertising'])
             # gettext needs to escape '"' thus we need to remove the escape character '\'
             ret['advertising'] = re.sub('\\\\"', '"', advertising)
+        if stanza.has_key('ubuntuhome'):
+            ret['ubuntuhome'] = stanza['ubuntuhome']
+        if stanza.has_key('projectubuntu'):
+            ret['projectubuntu'] = stanza['projectubuntu']
 
     return ret
 
diff --git a/webtools/templates/debian2ubuntu-termometer.sh b/webtools/templates/debian2ubuntu-termometer.sh
index 4fb5dab..b2d084d 100755
--- a/webtools/templates/debian2ubuntu-termometer.sh
+++ b/webtools/templates/debian2ubuntu-termometer.sh
@@ -5,4 +5,5 @@ sed \
     -e 's%\(<th>stable</th><th>testing</th><th>unstable</th><th>stable-bpo</th>\)<th>experimental</th><th>UNRELEASED</th>%\1<th>precise</th><th>quantal</th><th>raring</th>%' \
     -e 's%''${pkg.debianstatus}''%''${pkg.ubuntustatus}''%' \
     -e 's%\(<td>${pkg.stable}</td><td>${pkg.testing}</td><td>${pkg.unstable}</td><td>${pkg.stable_bpo}</td>\)<td>${pkg.experimental}</td><td>${pkg.UNRELEASED}</td>%\1<td>${pkg.precise}</td><td>${pkg.quantal}</td><td>${pkg.raring}</td>%' \
+    -e 's%\(<div class="link"><a href=".\)u\(thermometer">\)Ubuntu\( Thermometer</a></div>\)%\1\2Debian\3%' \
     thermometer.xhtml > uthermometer.xhtml
diff --git a/webtools/templates/thermometer.xhtml b/webtools/templates/thermometer.xhtml
index 46d288e..469da10 100644
--- a/webtools/templates/thermometer.xhtml
+++ b/webtools/templates/thermometer.xhtml
@@ -27,6 +27,19 @@
       <div class="sectionTop"/>
       <div class="row">${idxsummary}</div>
     </div>
+    <div py:if="ubuntuhome">
+      <div py:if="projectubuntu">
+        <span class="section">Links</span>
+        <div class="section">
+          <div class="sectionTop"/>
+          <div class="row">
+             <div class="link"><a href="$homepage">$projectname</a></div>
+             <div class="link"><a href="$ubuntuhome">$projectubuntu</a></div>
+             <div class="link"><a href="$uthermometer">Ubuntu Thermometer</a></div>
+          </div>
+        </div>
+      </div>
+    </div>
     <span class="section">Color legend</span>
     <div class="section">
       <div class="sectionTop"/>
diff --git a/webtools/templates/uthermometer.xhtml b/webtools/templates/uthermometer.xhtml
index d6bd4df..935377d 100644
--- a/webtools/templates/uthermometer.xhtml
+++ b/webtools/templates/uthermometer.xhtml
@@ -27,6 +27,19 @@
       <div class="sectionTop"/>
       <div class="row">${idxsummary}</div>
     </div>
+    <div py:if="ubuntuhome">
+      <div py:if="projectubuntu">
+        <span class="section">Links</span>
+        <div class="section">
+          <div class="sectionTop"/>
+          <div class="row">
+             <div class="link"><a href="$homepage">$projectname</a></div>
+             <div class="link"><a href="$ubuntuhome">$projectubuntu</a></div>
+             <div class="link"><a href="$thermometer">Debian Thermometer</a></div>
+          </div>
+        </div>
+      </div>
+    </div>
     <span class="section">Color legend</span>
     <div class="section">
       <div class="sectionTop"/>
diff --git a/webtools/thermometer.py b/webtools/thermometer.py
index 3ebe2ee..588d395 100755
--- a/webtools/thermometer.py
+++ b/webtools/thermometer.py
@@ -284,14 +284,6 @@ def main():
     
     t = datetime.now()
     
-    outputfile  = outputdir + '/' + blendname + '_thermometer.html'
-    uoutputfile = outputdir + '/ubuntu_' + blendname + '_thermometer.html'
-    try:
-        os.unlink(outputfile)
-        os.unlink(uoutputfile)
-    except: # simply continue if file does not exist
-        pass
-
     # Initialize i18n
     domain = 'blends-webtools'
     gettext.install(domain)
@@ -324,11 +316,20 @@ the right shows the tasks of %s.""" ) \
                                       % ('<a href="http://blends.alioth.debian.org/blends/">', '</a>', data['projectname']))
     data['idxsummary']        = Markup(to_unicode(data['idxsummary']))
 
-    for key in ('projecturl', 'projectname', 'logourl', 'advertising'):
+    for key in ('homepage', 'projecturl', 'projectname', 'logourl', 'ubuntuhome', 'projectubuntu'):
         data[key] = config[key]
-    # data['updatetimestamp']   = to_unicode(_('Last update:')) + ' ' + formatdate(time.mktime(t.timetuple()))
-    data['updatetimestamp']   = 'Last update:' + ' ' + formatdate(time.mktime(t.timetuple()))
-    
+    data['updatetimestamp']   = to_unicode(_('Last update:')) + ' ' + formatdate(time.mktime(t.timetuple()))
+
+    data['thermometer']  = blendname + '_thermometer.html'
+    data['uthermometer'] = 'ubuntu_' + blendname + '_thermometer.html'
+    outputfile  = outputdir + '/' + data['thermometer']
+    uoutputfile = outputdir + '/' + data['uthermometer']
+    try:
+        os.unlink(outputfile)
+        os.unlink(uoutputfile)
+    except: # simply continue if file does not exist
+        pass
+
     f = open(outputfile, 'w')
     template = loader.load('thermometer.xhtml')
     print >> f, template.generate(**data).render('xhtml')
diff --git a/webtools/webconf/debian-gis.conf b/webtools/webconf/debian-gis.conf
index e946c46..ba56c1e 100644
--- a/webtools/webconf/debian-gis.conf
+++ b/webtools/webconf/debian-gis.conf
@@ -12,3 +12,5 @@ VcsDir:      svn://anonscm.debian.org/svn/blends/projects/gis/trunk/debian-gis
 CSS:         ../inc/style.css
 PkgList:     pkg-grass-devel at lists.alioth.debian.org
 Distribution: Debian
+UbuntuHome:  https://wiki.ubuntu.com/UbuntuGIS
+ProjectUbuntu: UbuntuGIS

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list