[Blends-commit] [SCM] website branch, master, updated. 92405e0e16f4b3821ce8bd270885d1d3420d3ac6

Ole Streicher olebole at debian.org
Sat Nov 28 12:37:49 UTC 2015


The following commit has been merged in the master branch:
commit 92405e0e16f4b3821ce8bd270885d1d3420d3ac6
Author: Ole Streicher <olebole at debian.org>
Date:   Sat Nov 28 13:37:43 2015 +0100

    Include debian-astro main page to templates for teaser package handling

diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index fce0515..0d692fd 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -1106,6 +1106,18 @@ class Tasks:
                                         break
                             logger.debug(" %s -> %s" % (enh, dep.properties['Enhances'][enh]))
 
+    @property
+    def PackageByName(self):
+        try:
+            return self._packageByName
+        except AttributeError:
+            deps = []
+            for task in self.tasks.values():
+                for d in task.dependencies.values():
+                    deps += d
+            self._packageByName = dict((dep.pkg, dep) for dep in deps)
+            return self._packageByName
+
     def __str__(self):
         ret = "Blendname: "       + self.blendname  + ", " \
               "Metapackagekeys: " + str(self.metapackagekeys) + ", "
diff --git a/webtools/tasks.py b/webtools/tasks.py
index fde73c5..80e6f1f 100755
--- a/webtools/tasks.py
+++ b/webtools/tasks.py
@@ -36,6 +36,7 @@ tasks.MarkupPreformatedStringsBlend()
 data = tasks.data
 data['tasks']            = tasks.GetTaskDescDict()
 data['taskskeys']        = tasks.metapackagekeys
+data['PackageByName']        = tasks.PackageByName
 try:
 	data['popconsubmit']     = tasks.popconsubmit
 except: 
@@ -198,6 +199,28 @@ the right shows the tasks of %s.""" ) \
 	f.close()
 	SetFilePermissions(outputfile)
 
+	try:
+		template = loader.load('%s_idx.xhtml' % tasks.blendname)
+		outputfile = tasks.data['outputdir'] + '/index'
+		if lang != 'xyz': # let 'en' be a language as any other and add suffix to file name
+			outputfile += '.' + language_dict[lang]['short'] + '.html'
+		try:
+			os.unlink(outputfile)
+		except: # simply continue if file does not exist
+			pass
+		f = open(outputfile, 'w')
+		try:
+			print >> f, template.generate(**data).render('xhtml')
+		except UnicodeDecodeError, errtxt:
+			print >> stderr, \
+			        "Some critical encoding problem occured when trying to render index for lang %s.\n%s" \
+			        % (lang, errtxt)
+
+		f.close()
+		SetFilePermissions(outputfile)
+	except:
+		pass
+
 	data['dependencies'] = {}
 	data['projects']     = {}
 
diff --git a/webtools/templates/debian-astro_idx.xhtml b/webtools/templates/debian-astro_idx.xhtml
new file mode 100644
index 0000000..ff0586d
--- /dev/null
+++ b/webtools/templates/debian-astro_idx.xhtml
@@ -0,0 +1,113 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}" lang="${lang}"
+      xmlns:py="http://genshi.edgewall.org/">
+  <head>
+    <title>$projectname Pure Blend</title>
+    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
+    <meta name="robots" content="noindex" />
+    <link href="http://blends.debian.org/css/debhandheld.css" media="screen" rel="stylesheet" type="text/css" />
+    <link href="http://blends.debian.org//css/debian.css" rel="stylesheet" type="text/css" />
+    <link href="http://blends.debian.org//css/blends.css" rel="stylesheet" type="text/css" />
+    <link rel="shortcut icon" href="http://www.debian.org/favicon.ico" />
+  </head>
+  <body>
+    <div id="header">
+      <div id="upperheader">
+	<div id="logo">
+	  <a href="http://www.debian.org/" title="Debian Home">
+	    <img src= "http://www.debian.org/Pics/openlogo-50.png"
+			 alt="Debian" width="50" height= "61" /></a>
+	  </div>
+	  <p class="section">Pure Blend</p>
+	</div>
+	<div id="navbar">
+	  <ul> 
+	    <li><a href="index.html">$projectname</a></li>
+	    <li><a href="tasks">$packages</a></li>
+	    <li><a href="contact.html">$contact</a></li>
+	    <li><a href="contribute.html">$contribute</a></li>
+	  </ul>
+	</div>
+	<p id="breadcrumbs">
+	  <a href="http://blends.debian.org">Debian Pure Blends</a>
+	  / $projectname
+	</p>
+      </div><!-- end header -->
+      <div id="content">
+	<div id="splash">
+	  <h1 id="astro">$projectname</h1>
+	</div>
+	<p>
+	  $projectname is a "Debian Pure Blend" with the aim to develop a
+	  Debian based operating system that fits the requirements of both
+	  professional and hobby astronomers. It integrates a large number of
+	  software packages covering telescope control, data reduction,
+	  presentation and other fields.
+	</p>
+
+	<h2>Featured packages</h2>
+	<py:for each="fp_row in [['kstars', 'python-astropy'], ['saods9', 'splash']]">
+	  <div class="line">
+		<py:for each="pkg_name in fp_row">
+		  <div class="col50">
+			<table>
+			  <tr>
+				<td style="border-top-style: none; width:150px;">
+				  <img src="${PackageByName[pkg_name].icon}" alt="" style="width:150px;" />
+				</td>
+				<td style="vertical-align:top; border-top-style: none;">
+				  <p style="margin-bottom:0;">
+					<strong>${PackageByName[pkg_name].pkg.capitalize()}:</strong>
+					<span py:choose="">
+					  <span py:when="PackageByName[pkg_name].desc.has_key(lang)">${PackageByName[pkg_name].desc[lang]['short']}</span>
+					  <span py:otherwise="">${PackageByName[pkg_name].desc['en']['short']}</span>
+					</span>
+					
+				  </p>
+				  <p style="margin-bottom:0;">
+					<a href="${PackageByName[pkg_name].properties['homepage']}">Home page</a>
+					- <a href="tasks/${PackageByName[pkg_name].taskname}#${PackageByName[pkg_name].pkg}">More...</a>
+				  </p>
+				</td>
+			  </tr>
+			</table>
+		  </div>
+		</py:for>
+	  </div>
+	</py:for>
+	
+	<h2>Installation</h2>
+	<p>
+	  On an existing Debian Stretch installation, you can get the
+	  $projectname Pure Blend just by installing
+	  its <a href="tasks">metapackages</a>.  During
+	  the installation on a new system, this will be possible
+	  during the installation process.
+	</p>
+	<p>
+	  If you're new to Debian and you'd like to try the $projectname
+	  Pure Blend without installing it on your computer, or if you'd like
+	  to perform a fresh installation of Debian with all the astronomy
+	  software ready-to-go, you might find the live images useful. Images
+	  will be produced that can be run from DVDs or USB sticks on both 32-bit
+	  and 64-bit Intel architectures.
+	</p>
+	<p>
+	  <strong>Note:</strong> $projectname is not available under Debian
+	  Jessie. Our plan is to deliver the first version together with
+	  Debian Stretch.
+	</p>
+    </div>
+    <div id="footer">
+      <hr class="hidecss" />
+      <p>${langavail}</p>
+      <py:for each="l in languages">
+	<span py:if="lang != l" class="navpara">
+	  <a href="index.${language_dict[l]['short']}.html" title="${language_dict[l]['title']}" hreflang="${language_dict[l]['htaccess']}" lang="${language_dict[l]['htaccess']}" rel="alternate">${language_dict[l]['printed']}</a>
+	</span>
+      </py:for>
+      <p>${howtosetlang}</p>
+      <address>${updatetimestamp}</address>
+    </div>
+  </body>
+</html>

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list