[Cdd-commits] r830 - in cdd/trunk/webtools: . templates
CDD Subversion Commit
noreply at alioth.debian.org
Wed Jun 18 07:02:22 UTC 2008
Author: tille
Date: Wed Jun 18 07:02:21 2008
New Revision: 830
Modified:
cdd/trunk/webtools/cddtasktools.py
cdd/trunk/webtools/templates/tasks.xhtml
Log:
Prepare structures for containing ddtp translations
Modified: cdd/trunk/webtools/cddtasktools.py
==============================================================================
--- cdd/trunk/webtools/cddtasktools.py (original)
+++ cdd/trunk/webtools/cddtasktools.py Wed Jun 18 07:02:21 2008
@@ -135,9 +135,10 @@
self.section = None # Section of package in the Debian hierarchy
self.filename = None # Filename of package in the Debian pool
self.wnpp = None # WNPP bug number
- self.pkgShortDesc = None # Prospective packages should have a description ...
- self.pkgLongDesc = None # ... which could be copied to (or from if exists)
+ self.desc = {} # Prospective packages should have a description ...
+ # ... which could be copied to (or from if exists)
# WNPP bug and finally can be used for packaging
+ self.desc['en'] = {} # An English description should be available in any case
self.pkgURL = None # URL of unofficial package
# sort these objects according to the package name
@@ -448,8 +449,8 @@
dep.license = 'non-free'
else:
dep.license = 'unknown'
- dep.pkgShortDesc = self.available.packages[component][dep.pkg].pkgShortDesc
- dep.pkgLongDesc = self.available.packages[component][dep.pkg].pkgLongDesc
+ dep.desc['en']['short'] = self.available.packages[component][dep.pkg].desc['en']['short']
+ dep.desc['en']['long'] = self.available.packages[component][dep.pkg].desc['en']['long']
dep.homepage = self.available.packages[component][dep.pkg].homepage
dep.version = self.available.packages[component][dep.pkg].version
dep.responsible = self.available.packages[component][dep.pkg].responsible
@@ -501,7 +502,7 @@
print >>stderr, "Dep not initiated before Pkg-Description %s -> something is wrong." \
% stanza['pkg-description'].splitlines()[0]
else:
- (dep.pkgShortDesc, dep.pkgLongDesc) = SplitDescription(stanza['pkg-description'])
+ (dep.desc['en']['short'], dep.desc['en']['long']) = SplitDescription(stanza['pkg-description'])
else:
if key not in KEYSTOIGNORE:
# Also ignore keys starting with X[A-Z]-
@@ -522,13 +523,19 @@
def _FindDependencyType(self, dep):
# Return the name of the Dependencytype to append the Dependency to the right list
if dep.component != {}:
+ # if the component is specified it must be an official package
return 'official'
if dep.pkgURL != None:
+ # if there is an URL to a Debian package, but we have no official package (see above)
+ # it mus be an official package
return 'unofficial'
- if dep.pkgShortDesc != None and dep.pkgLongDesc != None:
- return 'prospective'
- print >>stderr, "DEBUG: insufficient information for pkg = %s, component = %s, pkgURL = %s, pkgShortDesc = %s, pkgLongDesc = %s" % \
- (dep.pkg, dep.component, dep.pkgURL, dep.pkgShortDesc, dep.pkgLongDesc)
+ if dep.desc['en'] != {}:
+ # if there is a short and long description available in the tasks file but no
+ # URL of a package we are dealing with a prospective package
+ if dep.desc['en']['short'] != None and dep.desc['en']['long'] != None:
+ return 'prospective'
+ print >>stderr, "DEBUG: insufficient information for pkg = %s, component = %s, pkgURL = %s, Desc = %s" % \
+ (dep.pkg, dep.component, dep.pkgURL, str(dep.desc['en']))
return 'unknown'
def MarkupPreformatedStrings(self):
@@ -537,9 +544,10 @@
for dependency in self.dependencies.keys():
for dep in self.dependencies[dependency]:
- dep.responsible = MarkupString(dep.responsible, dep.pkg, 'responsible')
- dep.pkgShortDesc = MarkupString(dep.pkgShortDesc, dep.pkg, 'pkgShortDesc')
- dep.pkgLongDesc = MarkupString(dep.pkgLongDesc, dep.pkg, 'pkgLongDesc')
+ dep.responsible = MarkupString(dep.responsible, dep.pkg, 'responsible')
+ if dep.desc['en'] != {}:
+ dep.desc['en']['short'] = MarkupString(dep.desc['en']['short'], dep.pkg, 'pkgShortDesc')
+ dep.desc['en']['long'] = MarkupString(dep.desc['en']['long'], dep.pkg, 'pkgLongDesc')
class Available:
@@ -616,7 +624,7 @@
for stanza in deb822.Sources.iter_paragraphs(g, shared_storage=False):
deppkg = DependantPackage()
- (deppkg.pkgShortDesc, deppkg.pkgLongDesc) = SplitDescription(stanza['description'])
+ (deppkg.desc['en']['short'], deppkg.desc['en']['long']) = SplitDescription(stanza['description'])
try:
deppkg.homepage = stanza['homepage']
except KeyError:
Modified: cdd/trunk/webtools/templates/tasks.xhtml
==============================================================================
--- cdd/trunk/webtools/templates/tasks.xhtml (original)
+++ cdd/trunk/webtools/templates/tasks.xhtml Wed Jun 18 07:02:21 2008
@@ -1,7 +1,7 @@
<!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="en" lang="en"
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}" lang="${lang}"
xmlns:py="http://genshi.edgewall.org/">
<head>
<title>$projectname</title>
@@ -56,8 +56,8 @@
<td class="project-name">
<a name="${project.pkg}" id="${project.pkg}"/>
<strong>${project.pkg.capitalize()}</strong>
- <span py:if="project.wnpp != None"> — <a href="http://bugs.debian.org/#${project.wnpp}">wnpp</a></span><br />
- <em>${project.pkgShortDesc}</em><br/>
+ <span py:if="project.wnpp != None"> - <a href="http://bugs.debian.org/#${project.wnpp}">wnpp</a></span><br />
+ <em>${project.desc['en']['short']}</em><br/>
<a href="$project.homepage}">${project.homepage}</a>
<div py:if="project.responsible != None"><span py:choose="type"><span py:when="'official'">${maintainer}</span><span py:otherwise="">${responsible}</span></span>: ${project.responsible}</div>
</td>
@@ -74,7 +74,7 @@
</td>
</tr>
<tr>
- <td colspan="2" class="project-description">${project.pkgLongDesc}
+ <td colspan="2" class="project-description">${project.desc['en']['long']}
</td>
</tr>
</tbody>
More information about the Cdd-commits
mailing list