[Cdd-commits] r1092 - in cdd/trunk/webtools: . templates
CDD Subversion Commit
noreply at alioth.debian.org
Sat Sep 20 08:46:45 UTC 2008
Author: tille
Date: Sat Sep 20 08:46:45 2008
New Revision: 1092
Modified:
cdd/trunk/webtools/distasktools.py
cdd/trunk/webtools/tasks.py
cdd/trunk/webtools/templates/tasks.xhtml
Log:
Sort official packages in groups of "Depends", "Recommends", "Suggests" to avoid only Suggested packages appearing on top of the list.
Modified: cdd/trunk/webtools/distasktools.py
==============================================================================
--- cdd/trunk/webtools/distasktools.py (original)
+++ cdd/trunk/webtools/distasktools.py Sat Sep 20 08:46:45 2008
@@ -270,7 +270,15 @@
# datastructure
ret = {}
if dependencytypes == ():
- # official: A package with this name is found in the Debian repository
+ # depends: A package in the main archive which is specified as 'Depends' in the tasks file
+ # recommends: A package in the main archive which is specified as 'Recommends' in the tasks file
+ # suggests: A package in the main archive which is specified as 'Suggests' in the tasks file
+ # or an official package out of contrib or non-free which was decreased to
+ # Suggests because a package in main may not depend from/recommend a package
+ # outside main
+ # ignored: A package in the main archive which is specified as 'Ignore' in the tasks file
+ # "Ignore" means the package might be interesting as a Dependency but is not
+ # tested / evaluated yet
# unofficial: The tasks file contains a tag Pkg-URL for the package which is not None
# prospective: At least a short and long description are attached to a package name which
# is not in the Debian pool and has no Pkg-URL for an unofficial package
@@ -278,7 +286,10 @@
# incomplete information. This usually happens when packages are not
# available in Debian any more (for instance this might happen if a
# name has changed)
- dependencytypes=('official', 'unofficial', 'prospective', 'unknown')
+ # Default is only official in this case because DDTP handles only
+ # official packages
+
+ dependencytypes=('depends', 'recommends', 'suggests', 'unofficial', 'prospective', 'unknown')
for task in self.metapackagekeys:
tdeps = self.tasks[task]
list = []
@@ -295,7 +306,7 @@
# datastructure
ret = []
if dependencytypes == ():
- dependencytypes=('official', 'unofficial', 'prospective', 'unknown')
+ dependencytypes=('depends', 'recommends', 'suggests', 'unofficial', 'prospective', 'unknown')
tdeps = self.tasks[task]
for dep in dependencytypes:
for tdep in tdeps.dependencies[dep]:
@@ -325,7 +336,7 @@
# name has changed)
# Default is only official in this case because DDTP handles only
# official packages
- dependencytypes=('official', )
+ dependencytypes=('depends', 'recommends', 'suggests', )
for task in self.metapackagekeys:
tdeps = self.tasks[task]
for dep in dependencytypes:
@@ -421,7 +432,9 @@
# Dictionary with dependencytype as key and list of DependantPackage
# instances
- self.dependencies = { 'official' : [],
+ self.dependencies = { 'depends' : [],
+ 'recommends' : [],
+ 'suggests' : [],
'unofficial' : [],
'prospective' : [],
'unknown' : []
@@ -625,7 +638,10 @@
# 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'
+ # return 'official'
+ # ... but we now start using more fine grained Dependency evaluation
+ # where official is split into 'Depends', 'Recommends' and 'Suggests'
+ return dep.dep_strength.lower()
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
Modified: cdd/trunk/webtools/tasks.py
==============================================================================
--- cdd/trunk/webtools/tasks.py (original)
+++ cdd/trunk/webtools/tasks.py Sat Sep 20 08:46:45 2008
@@ -36,6 +36,12 @@
data['languages'] = languages
# Work around the fact that it seems to be impossible to mention '&' in the template
data['ampandworkaround'] = Markup('&force=1')
+data['typeclass'] = dict ( depends = 'official',
+ recommends = 'official',
+ suggests = 'official',
+ unofficial = 'unofficial',
+ prospective = 'prospective'
+ )
# Define directories used
current_dir = os.path.dirname(__file__)
@@ -83,7 +89,9 @@
data['version'] = _('Version')
data['summary'] = _('Summary')
data['updatetimestamp'] = _('Last update:') + ' ' + formatdate(time.mktime(t.timetuple()))
- data['officialpkg'] = _('Official Debian package')
+ data['dependantpkg'] = _('Official Debian package')
+ data['recommendedpkg'] = _('Official Debian package (recommended)')
+ data['suggestedpkg'] = _('Official Debian package (suggested)')
data['nonfreepkg'] = _('Debian package in non-free')
data['contribpkg'] = _('Debian package in contrib')
data['unofficialpkg'] = _('Unofficial Debian package')
@@ -121,12 +129,16 @@
}
typenames = dict (
- official = _('Official'),
+ depends = _('Dependant'),
+ recommends = _('Recommended'),
+ suggested = _('Suggested'),
unofficial = _('Unofficial'),
prospective = _('Prospective')
)
data['typeheading'] = dict (
- official = _('Official Debian packages'),
+ depends = _('Official Debian packages'),
+ recommends = _('Official Debian packages (Recommended)'),
+ suggests = _('Official Debian packages (Suggested)'),
unofficial = _('Experimental or unofficial Debian packages, projects with packaging stuff in SVN'),
prospective = _('Debian packages not available')
)
@@ -169,7 +181,7 @@
data['projectkeys'] = cdeps.GetListOfDepsForTask(task, dependencytypes=())
data['dependencies'] = []
data['colorcodes'] = []
- for type in ['official', 'unofficial', 'prospective', 'unknown']:
+ for type in ['depends', 'recommends', 'suggests', 'unofficial', 'prospective', 'unknown']:
if len(cdeps.tasks[task].dependencies[type]) > 0:
if type == 'unknown':
# Just print an error message if there are packages with unknown status
@@ -179,7 +191,7 @@
print >>stderr, "Warning: Dependency with unknown status:", dep.pkg
else:
data['dependencies'].append(type)
- data['colorcodes'].append(Markup(COLORCODES[type]))
+ data['colorcodes'].append(Markup(COLORCODES[data['typeclass'][type]]))
data['projects'] = cdeps.tasks[task].dependencies
data['othertasks'] = _("Links to other tasks")
data['indexlink'] = _("Index of all tasks")
Modified: cdd/trunk/webtools/templates/tasks.xhtml
==============================================================================
--- cdd/trunk/webtools/templates/tasks.xhtml (original)
+++ cdd/trunk/webtools/templates/tasks.xhtml Sat Sep 20 08:46:45 2008
@@ -75,7 +75,7 @@
<py:for each="project in projects[type]">
<table class="project" summary="${project.pkg}">
<tbody>
- <tr class="deb-${type}">
+ <tr class="deb-${typeclass[type]}">
<td class="project-name">
<a name="${project.pkg}" id="${project.pkg}"/>
<strong>${project.pkg.capitalize()}</strong>
@@ -89,7 +89,7 @@
<span py:when="'#'">${nohomepage}</span>
<span py:otherwise=""><a href="$project.homepage">${project.homepage}</a></span>
</div>
- <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>
+ <div py:if="project.responsible != None"><span py:choose="typeclass[type]"><span py:when="'official'">${maintainer}</span><span py:otherwise="">${responsible}</span></span>: ${project.responsible}</div>
</td>
<td class="project-license">
<em py:if="project.version != None">${version}: ${project.version}</em><br />
More information about the Cdd-commits
mailing list