[Blends-commit] [SCM] website branch, master, updated. 4360c0c60f0cbebab008018804ced4723451c3ac
Ole Streicher
olebole at debian.org
Thu Mar 10 20:19:33 UTC 2016
The following commit has been merged in the master branch:
commit 4360c0c60f0cbebab008018804ced4723451c3ac
Author: Ole Streicher <olebole at debian.org>
Date: Thu Mar 10 21:17:10 2016 +0100
Further reunifx old and udd versions
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index a3afe48..4f37804 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -92,8 +92,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends'),
'fields-set' : (),
'colorcode' : 'Green: The project is <a href="#%s">available as an official Debian package and has high relevance</a>',
- 'headline' : 'Official Debian packages with high relevance',
- 'pdolinkname' : 'Official Debian package',
'order' : 1
},
'official_low': { # official package with low priority dependency
@@ -102,8 +100,6 @@ pkgstatus = {
'dependencies' : ('Suggests', ),
'fields-set' : (),
'colorcode' : 'Green: The project is <a href="#%s">available as an official Debian package but has lower relevance</a>',
- 'headline' : 'Official Debian packages with lower relevance',
- 'pdolinkname' : 'Official Debian package',
'order' : 2
},
'non-free': { # package in contrib or non-free, priority decreased to Suggests in any case
@@ -112,8 +108,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : (),
'colorcode' : 'Green: The project is <a href="#%s">available in Debian packaging pool but is not in Debian main</a>',
- 'headline' : 'Debian packages in contrib or non-free',
- 'pdolinkname' : 'Debian package in contrib/non-free',
'order' : 3
},
'experimental': { # package which exists only in experimental
@@ -122,8 +116,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : (),
'colorcode' : 'Yellow: The project is <a href="#%s">available in Debian packaging pool but is regarded as experimental</a>',
- 'headline' : 'Debian packages in experimental',
- 'pdolinkname' : 'Debian package in experimental',
'order' : 4
},
'new': { # package in new queue
@@ -132,8 +124,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : (),
'colorcode' : 'Yellow: A package of project is <a href="#%s">is in Debian New queue and hopefully available soon</a>',
- 'headline' : 'Debian packages in New queue (hopefully available soon)',
- 'pdolinkname' : 'New Debian package',
'order' : 5
},
'pkgvcs': { # Not yet packaged but packaging code in Vcs
@@ -142,8 +132,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : ('vcs-svn', 'vcs-git', 'vcs-browser'),
'colorcode' : 'Yellow: The packaging of project is <a href="#%s">has started and a developer might try the packaging code in VCS or help packaging.</a>',
- 'headline' : 'Packaging has started and developers might try the packaging code in VCS',
- 'pdolinkname' : 'New Debian package',
'order' : 6
},
'unofficial': { # unofficial packages outside Debian
@@ -152,8 +140,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : ('pkg-url', ),
'colorcode' : 'Yellow: There exists an <a href="#%s">unofficial package</a> of the project',
- 'headline' : 'Unofficial packages built by somebody else',
- 'pdolinkname' : 'Unofficial Debian package',
'order' : 7
},
'wnpp': { # project which has at least a WNPP bug filed
@@ -162,8 +148,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : ('wnpp', ),
'colorcode' : 'Red: The project is <a href="#%s">not (yet) available as a Debian package</a> but there is some record of interest (WNPP bug).',
- 'headline' : 'No known packages available but some record of interest (WNPP bug)',
- 'pdolinkname' : 'Debian package not available',
'order' : 8
},
'prospective': { # projects which might be interesting for a Blend but no work is done yet
@@ -172,8 +156,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : ('homepage', ), # TODO: a description should be set as well ...
'colorcode' : 'Red: The project is <a href="#%s">not (yet) available as a Debian package</a>.',
- 'headline' : 'Should not show up here',
- 'pdolinkname' : '',
'order' : 9
},
'ignore': { # Package inside Debian which is "under observation"
@@ -182,8 +164,6 @@ pkgstatus = {
'dependencies' : ('Ignore', ),
'fields-set' : (),
'colorcode' : '%s',
- 'headline' : 'Should not show up here',
- 'pdolinkname' : '',
'order' : 10
},
'avoid': { # Package inside Debian which should not go to a install medium of the Blend
@@ -192,8 +172,6 @@ pkgstatus = {
'dependencies' : ('Avoid', ),
'fields-set' : (),
'colorcode' : '%s',
- 'headline' : 'Should not show up here',
- 'pdolinkname' : '',
'order' : 11
},
'unknown': { # Everything else
@@ -202,8 +180,6 @@ pkgstatus = {
'dependencies' : ('Depends', 'Recommends', 'Suggests'),
'fields-set' : (),
'colorcode' : 'White: The project has an %s status.',
- 'headline' : 'Should not show up here',
- 'pdolinkname' : '',
'order' : 100
},
}
diff --git a/webtools/tasks.py b/webtools/tasks.py
index 4ed6f56..61abbe5 100755
--- a/webtools/tasks.py
+++ b/webtools/tasks.py
@@ -1,14 +1,10 @@
-#!/usr/bin/python
+#!/usr/bin/env python
-import apt
-import apt_pkg
-import apt_inst
import codecs
import json
from sys import argv, exit, stderr
import os
-import re
import gettext
import time
@@ -36,9 +32,11 @@ tasks.GetAllDependentPackagesOfBlend()
tasks.MarkupPreformatedStringsBlend()
data = tasks.data
+data['timestamp'] = formatdate(time.mktime(datetime.now().timetuple()))
data['tasks'] = tasks.GetTaskDescDict()
data['taskskeys'] = tasks.metapackagekeys
-data['PackageByName'] = tasks.PackageByName
+data['PackageByName'] = tasks.PackageByName
+data['pkgcount'] = len(data['PackageByName'])
try:
data['popconsubmit'] = tasks.popconsubmit
except:
diff --git a/webtools/tasks_udd.py b/webtools/tasks_udd.py
index 5139939..d10881d 100755
--- a/webtools/tasks_udd.py
+++ b/webtools/tasks_udd.py
@@ -1,14 +1,10 @@
-#!/usr/bin/env python3
+#!/usr/bin/env python
-import apt
-import apt_pkg
-import apt_inst
import codecs
import json
from sys import argv, exit, stderr
import os
-import re
import gettext
import time
@@ -36,7 +32,6 @@ tasks.GetAllDependentPackagesOfBlend()
tasks.MarkupPreformatedStringsBlend()
data = tasks.data
-# print("data : \n",data)
data['timestamp'] = formatdate(time.mktime(datetime.now().timetuple()))
data['tasks'] = tasks.GetTaskDescDict()
data['taskskeys'] = tasks.metapackagekeys
@@ -83,7 +78,7 @@ with open(os.path.join(outputdir, 'tasks.json'), 'w') as fp:
json.dump(data, fp, indent=4, sort_keys=True, cls=DefaultEncoder)
t = datetime.now()
-htaccess = os.path.join(outputdir, 'htaccess')
+htaccess = os.path.join(outputdir, '.htaccess')
htafp = open(htaccess, 'w')
htafp.write("DirectoryIndex index index.html\nOptions +MultiViews\n")
@@ -91,23 +86,85 @@ use_dependencystatus = GetDependencies2Use()
for lang in languages:
htafp.write("AddLanguage {0} .{1}\n".format(language_dict[lang]['htaccess'], lang))
l10nstring[lang].install()
- # _ = l10nstring[lang].ugettext
+ _ = l10nstring[lang].ugettext
data['lang'] = lang
+ data['license'] = _('License')
+ data['version'] = _('Version')
+ data['summary'] = _('Summary')
+ data['updatetimestamp'] = _('Last update:') + ' ' + formatdate(time.mktime(t.timetuple()))
+ data['nopkgavail'] = _('Debian package not available')
# Description of package in specific packges (same for Depends, Recommends, Suggests)
+ data['legend'] = _("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(_(
+ """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 <a href="mailto:%s">%s mailing list</a>""")
+ % (data['projectname'], data['projectlist'], data['projectname']))
+ data['bugs'] = _('Bugs')
+ data['thermometer'] = _('Thermometer')
+ data['maintstats'] = _('Maintainer Stats')
+ data['contact'] = _('Contact')
+ data['contribute'] = _('Contribute')
+ data['description'] = _('Description')
+ data['metapackage'] = _('Metapackage')
+ data['packages'] = _('Packages')
+ data['gtstrTasksPage'] = _('Tasks page')
+ data['gtstrProject'] = _('Project')
+ data['gtstrThisIsAList'] = _('This is a list of the Tasks %s is made of:') % data['projectname']
+ data['langavail'] = _('This page is also available in the following languages:')
+ data['howtosetlang'] = _('How to set <a href="%s">the default document language</a>')
+ data['howtosetlang'] = Markup(data['howtosetlang'] % ('http://www.debian.org/intro/cn.%s.html' % lang))
+ data['nohomepage'] = _('Homepage not available')
+ data['translatedesc'] = _('Translate description')
+ data['fixtranslation'] = _('Fix translated description')
+ data['popconexplanation'] = _('Popularitycontest results: number of people who use this package regularly (number of people who upgraded this package recently) out of')
+ data['tableofcontents'] = _('Table of contents')
+ data['packagelist'] = _('complete packagelist')
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
advertising = data['advertising']
# data['projectadvertising'] = _(advertising) # Hopefully translation will work this way ...
# Genshi needs explicite information that it is dealing with an UTF-8 string which should not be changed
- # advertising = _(advertising)
+ advertising = _(advertising)
data['projectadvertising'] = Markup(advertising)
else:
data['projectadvertising'] = None
+ data['packages'] = _('Packages')
+ data['idxsummary'] = _('''The {0} Pure Blend contains {1} packages which
+ 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'], len(data['PackageByName']))
+
+ pkgstatus['official_high']['headline'] = _('Official Debian packages with high relevance')
# before fiddling around with unicode() read
# http://www.red-mercury.com/blog/eclectic-tech/python-unicode-fixing-utf-8-encoded-as-latin-1-iso-8859-1/
-
+ pkgstatus['official_high']['pdolinkname'] = _('Official Debian package')
+ pkgstatus['official_low'] ['headline'] = _('Official Debian packages with lower relevance')
+ pkgstatus['official_low'] ['pdolinkname'] = pkgstatus['official_high']['pdolinkname']
+ pkgstatus['non-free'] ['headline'] = _('Debian packages in contrib or non-free')
+ pkgstatus['non-free'] ['pdolinkname'] = _('Debian package in contrib/non-free')
+ pkgstatus['experimental'] ['headline'] = _('Debian packages in experimental')
+ pkgstatus['experimental'] ['pdolinkname'] = _('Debian package in experimental')
+ pkgstatus['new'] ['headline'] = _('Debian packages in New queue (hopefully available soon)')
+ pkgstatus['new'] ['pdolinkname'] = _('New Debian package')
+ pkgstatus['pkgvcs'] ['headline'] = _('Packaging has started and developers might try the packaging code in VCS')
+ pkgstatus['pkgvcs'] ['pdolinkname'] = _('Unofficial Debian package')
+ pkgstatus['unofficial'] ['headline'] = _('Unofficial packages built by somebody else')
+ pkgstatus['unofficial'] ['pdolinkname'] = pkgstatus['pkgvcs']['pdolinkname']
+ pkgstatus['prospective'] ['headline'] = _('No known packages available')
+ pkgstatus['prospective'] ['pdolinkname'] = _('Debian package not available')
+ pkgstatus['wnpp'] ['headline'] = _('No known packages available but some record of interest (WNPP bug)')
+ pkgstatus['wnpp'] ['pdolinkname'] = pkgstatus['prospective']['pdolinkname']
+ # Ignore/Avoid is only relevant for blends-dev, not webtools
+ pkgstatus['ignore'] ['headline'] = 'Should not show up here'
+ pkgstatus['prospective'] ['pdolinkname'] = ''
+ pkgstatus['avoid'] ['headline'] = 'Should not show up here'
+ pkgstatus['prospective'] ['pdolinkname'] = ''
+ pkgstatus['unknown'] ['headline'] = 'Should not show up here' # There must be a bug somewhere
+ pkgstatus['prospective'] ['pdolinkname'] = ''
+
# Create the index page
# Make sure that strings that need to be rendered as they are because they might
# contain several html tags will be marked correctly
@@ -118,26 +175,17 @@ for lang in languages:
template = loader.load('tasks_idx.xhtml')
- outputfile = os.path.join(outputdir, 'index.{0}.html'.format(lang))
+ outputfile = os.path.join(outputdir,
+ 'index.{0}.html'.format(language_dict[lang]['short']))
with codecs.open(outputfile, 'w', 'utf-8') as f:
- try:
f.write(template.generate(**data).render('xhtml'))
- except UnicodeDecodeError as err:
- stderr.write("Some critical encoding problem occured when trying"
- + " to render index for lang {0}.\n{1}\n"
- .format(lang, str(err)))
SetFilePermissions(outputfile)
try:
template = loader.load('%s_idx.xhtml' % tasks.blendname)
outputfile = os.path.join(tasks.data['outputdir'],
- 'index.{0}.html'.format(lang))
+ 'index.{0}.html'.format(language_dict[lang]['short']))
with codecs.open(outputfile, "w", "utf-8") as f:
- try:
- f.write(template.generate(**data).render('xhtml'))
- except UnicodeDecodeError as err:
- stderr.write("Some critical encoding problem occured when trying"
- + " to render index for lang {0}.\n{1}\n"
- .format(lang, str(err)))
+ f.write(template.generate(**data).render('xhtml'))
SetFilePermissions(outputfile)
except:
pass
@@ -154,9 +202,9 @@ for lang in languages:
data['headline'][status] = Markup(pkgstatus[status]['headline'])
data['pdolinkname'][status] = Markup(pkgstatus[status]['pdolinkname'])
if pkgstatus[status]['order'] <= pkgstatus['experimental']['order']:
- data['maintainer'][status] = ('Maintainer')
+ data['maintainer'][status] = _('Maintainer')
else:
- data['maintainer'][status] = ('Responsible')
+ data['maintainer'][status] = _('Responsible')
for task in data['taskskeys']:
data['task'] = task
@@ -175,20 +223,18 @@ for lang in languages:
% dep.pkg)
# Keep the Project lists per task to be able to loop over all tasks in plain package list
data['projects'][task] = tasks.tasks[task].dependencies
+ data['othertasks'] = _("Links to other tasks")
+ data['indexlink'] = _("Index of all tasks")
if data['projectname'] in ('Debian Astro', 'Debian Hamradio'):
template = loader.load('packages.xhtml')
else:
template = loader.load('tasks.xhtml')
- outputfile = os.path.join(outputdir, '{0}.{1}.html'.format(task, lang))
+ outputfile = os.path.join(
+ outputdir, '{0}.{1}.html'.format(task, language_dict[lang]['short']))
with codecs.open(outputfile, "w", "utf-8") as f:
- try:
- f.write(template.generate(**data).render('xhtml'))
- except UndefinedError as err:
- stderr.write("UndefinedError while rendering"
- + " task {0} for lang {1}.\n{2}\n"
- .format(task, lang, str(err)))
+ f.write(template.generate(**data).render('xhtml'))
SetFilePermissions(outputfile)
template = loader.load('packagelist.xhtml')
@@ -199,22 +245,9 @@ for lang in languages:
outputfile = os.path.join(outputdir, 'packagelist.{0}.html'.format(lang))
with codecs.open(outputfile, 'w', 'utf-8') as f:
- try:
- f.write(template.generate(**data).render('xhtml'))
- except UnicodeDecodeError as err:
- stderr.write("Some critical encoding problem occured when trying"
- + " to render long package list for lang {0}.\n{1}\n"
- .format((lang, str(err))))
- except UndefinedError as err:
- stderr.write("UndefinedError while trying to render"
- + " long package list for lang {0}.\n{1}\n"
- .format(lang, str(err)))
+ f.write(template.generate(**data).render('xhtml'))
SetFilePermissions(outputfile)
-htafp.write("LanguagePriority ")
-for lang in languages:
- htafp.write(language_dict[lang]['htaccess'] + ' ')
-htafp.write("\n")
htafp.write("LanguagePriority {0}\n".format(
' '.join(language_dict[lang]['htaccess']) for lang in languages))
--
Static and dynamic websites for Debian Pure Blends
More information about the Blends-commit
mailing list