[Blends-commit] [SCM] website branch, master, updated. 58b347eab8ae054cc759eade81274a4d67d3e444

2015-11-28 Thread Ole Streicher
The following commit has been merged in the master branch:
commit 58b347eab8ae054cc759eade81274a4d67d3e444
Author: Ole Streicher 
Date:   Sat Nov 28 12:47:42 2015 +0100

I18n for new task index

diff --git a/webtools/tasks.py b/webtools/tasks.py
index adcd938..fde73c5 100755
--- a/webtools/tasks.py
+++ b/webtools/tasks.py
@@ -90,16 +90,23 @@ for lang in languages:
data['lang']  = lang
data['license']   = to_unicode(_('License'))
data['version']   = to_unicode(_('Version'))
-data['summary']   = to_unicode(_('Summary'))
+   data['summary']   = to_unicode(_('Summary'))
data['updatetimestamp']   = to_unicode(_('Last update:')) + ' ' + 
formatdate(time.mktime(t.timetuple()))
-data['nopkgavail']= to_unicode(_('Debian package not 
available'))
+   data['nopkgavail']= to_unicode(_('Debian package not 
available'))
# Description of package in specific packges (same for Depends, 
Recommends, Suggests)
-data['legend']= to_unicode(_("For a better overview of the 
project's availability as a Debian package, each head row has a color code 
according to this scheme:"))
-data['discovery'] = Markup(to_unicode(_("""If you discover a 
project which looks like a good candidate for %s
-  to you, or if you have prepared an unofficial 
Debian package, please do not hesitate to
-  send a description of that project to the mailto:%s";>%s mailing list""") % \
-  (data['projectname'], data['projectlist'], 
data['projectname'])))
-data['description']   = to_unicode(_("The list to the right 
includes various software projects which are of some interest to the %s 
Project. Currently, only a few of them are available as Debian packages. It is 
our goal, however, to include all software in %s which can sensibly add to a 
high quality Debian Pure Blend.") % (data['projectname'], data['projectname']))
+   data['legend']= to_unicode(_("For a better overview of the 
project's availability as a Debian package, each head row has a color code 
according to this scheme:"))
+   data['discovery'] = Markup(to_unicode(_("""If you discover a 
project which looks like a good candidate for %s
+ to you, or if you have prepared an unofficial 
Debian package, please do not hesitate to
+ send a description of that project to the mailto:%s";>%s mailing list""") % \
+ (data['projectname'], 
data['projectlist'], data['projectname'])))
+   data['bugs']   = to_unicode(_('Bugs'))
+   data['thermometer']= to_unicode(_('Thermometer'))
+   data['maintstats'] = to_unicode(_('Maintainer Stats'))
+   data['contact']= to_unicode(_('Contact'))
+   data['contribute'] = to_unicode(_('Contribute'))
+   data['description']= to_unicode(_('Description'))
+   data['metapackage']= to_unicode(_('Metapackage'))
+   data['packages']   = to_unicode(_('Packages'))
data['gtstrTasksPage'] = to_unicode(_('Tasks page'))
data['gtstrProject']   = to_unicode(_('Project'))
data['gtstrThisIsAList']   = to_unicode(_('This is a list of the Tasks 
%s is made of:') % data['projectname'])
@@ -112,6 +119,10 @@ for lang in languages:
data['popconexplanation']  = to_unicode(_('Popularitycontest results: 
number of people who use this package regularly (number of people who upgraded 
this package recently) out of'))
data['tableofcontents']= to_unicode(_('Table of contents'))
data['packagelist']= to_unicode(_('complete packagelist'))
+   data['tasksintro']  = to_unicode(_('''The packages of the {0}
+   Pure Blend are grouped by metapackages. Each metapackage will cause 
the
+   installation of packages for a specific topic. The following table 
lists
+   the metapackages of {0}''').format((data['projectname'])))
if data['advertising'] != None:
# If data['advertising'] is enclosed in _() gettext tries to 
ask for translations of 'advertising'
# which makes no sense.  That's why this is masked by an extra 
string variable
@@ -123,11 +134,11 @@ for lang in languages:
else:
data['projectadvertising'] = None
 
-data['packages']  = to_unicode(_('Packages'))
+   data['packages']  = to_unicode(_('Packages'))
data['idxsummary']= to_unicode(_("""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.""" ) \
-  % ('http://blends.alioth.debian.o

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

2015-11-28 Thread Ole Streicher
The following commit has been merged in the master branch:
commit 92405e0e16f4b3821ce8bd270885d1d3420d3ac6
Author: Ole Streicher 
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 000..ff0586d
--- /dev/null
+++ b/webtools/templates/debian-astro_idx.xhtml
@@ -0,0 +1,113 @@
+http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd";>
+http://www.w3.org/1999/xhtml"; xml:lang="${lang}" lang="${lang}"
+  xmlns:py="http://genshi.edgewall.org/";>
+  
+$projectname Pure Blend
+
+
+http://blends.debian.org/css/debhandheld.css"; media="screen" 
rel="stylesheet" type="text/css" />
+http://blends.debian.org//css/debian.css"; rel="stylesheet" 
type="text/css" />
+http://blends.debian.org//css/blends.css"; rel="stylesheet" 
type="text/css" />
+http://www.debian.org/favicon.ico"; />
+  
+  
+
+  
+   
+ http://www.debian.org/"; title="Debian Home">
+   http://www.debian.org/Pics/openlogo-50.png";
+alt="Debian" width="50" height= "61" />
+ 
+ Pure Blend
+   
+   
+  
+   $projectname
+   $packages
+   $contact
+   $contribute
+ 
+   
+   
+ http://blends.debian.org";>Debian Pure Blends
+ / $projectname
+   
+  
+  
+   
+ $projectname
+   
+   
+ $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.
+   
+
+   Featured packages
+   
+ 
+   
+ 
+   
+ 
+   
+ 
+   
+   
+ 
+   
${PackageByName[pkg_name].pkg.capitalize()}:
+   
+ ${PackageByName[pkg_name].desc[lang]['short']}
+