[Blends-commit] [SCM] website branch, master, updated. 2423a15d835ab6840aa1c1f75c4bc939ae7eef3d
Ole Streicher
olebole at debian.org
Sat Mar 19 13:53:04 UTC 2016
The following commit has been merged in the master branch:
commit 35e1cbd6ce38d593eb9724f0328778dd761d8793
Author: Ole Streicher <olebole at debian.org>
Date: Sat Mar 19 13:56:13 2016 +0100
Move versions and outdated flag to properties
diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 68a0e7c..888c984 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -735,9 +735,8 @@ class DependantPackage:
self.properties['Enhances'] = {} # Dictionary Enhancing pkg name as key, Link to package information as value; empty in most cases
# because Enhances relations are quite seldom
self.properties['stable_testing_version'] = [] # (release, version) tuples where release is codename for stable and testing
+ self.properties['version'] = [] # list of {'release', 'version', 'archs'} dictionary containing version and architecture information
self.vcs_found = 0 # we need a flag to store the fact whether Vcs information of a package is in UDD
- self.version = [] # list of {'release', 'version', 'archs'} dictionary containing version and architecture information
- self.outdated = {} # If not empty directory then release='upstream' and package is outdated
self.filename = None # Filename of package in the Debian pool
self.desc = {} # Prospective packages should have a description ...
# ... which could be copied to (or from if exists)
@@ -766,14 +765,10 @@ class DependantPackage:
ret += ", releases: " + str(self.releases)
if self.component:
ret += ", component: " + self.component
- if self.version:
- ret += ", versions: " + str(self.version)
if self.desc:
ret += ", desc: " + str(self.desc)
for prop in self.properties:
ret += ", %s: %s" % (prop, str(self.properties[prop]))
- if self.outdated:
- ret += ", dehsstatus = " + str(self.outdated)
# if self.desc['en']:
# ret += ", desc['en']:" + str(self.desc['en'])
@@ -970,12 +965,12 @@ class Tasks:
pkgList = []
for dep in use_dependencystatus:
for tdep in tdeps.dependencies[dep]:
- if tdep.outdated != {}:
+ if 'outdated' in tdep.properties:
# versions are ordered lists ---v--- last one is needed
pkgList.append({
'name': tdep.pkg,
- 'debian_version': tdep.version[-1]['version'],
- 'upstream_version': tdep.outdated['version'],
+ 'debian_version': tdep.properties['version'][-1]['version'],
+ 'upstream_version': tdep.properties['outdated']['version'],
'maintainer': tdep.properties.get('maintainer'),
'uploader': tdep.properties.get('uploader'),
})
@@ -1504,7 +1499,8 @@ class TaskDependencies:
if 'releases' in row:
for rel, ver, arch in zip(row['releases'], row['versions'],
row['architectures']):
- dep.version.append({
+ dep.properties['version'].append({
+ 'url': 'https://packages.debian.org/{0}/${1}'.format(rel, dep.pkg),
'release': rel,
'version': ver,
'archs': arch
@@ -1546,9 +1542,11 @@ class TaskDependencies:
# it might be that the new upstream goes to experimental - this should be ignored here
if row.get('unstable_parsed_version'):
- dep.outdated['release'] = 'upstream'
- dep.outdated['version'] = row['unstable_upstream']
- dep.outdated['architectures'] = ''
+ dep.properties['outdated'] = {
+ 'release': 'upstream',
+ 'version': row['unstable_upstream'],
+ 'architectures': 'all',
+ }
if row['changed_by']:
changed = row['changed_by']
@@ -1615,7 +1613,8 @@ class TaskDependencies:
self.dependencies['new'].append(dep)
dep.pkgstatus = 'new'
dep.component = row['component']
- dep.version = [row['version']]
+ dep.properties['version'].append({'archs':'all', 'release':'NEW',
+ 'version':row['version']})
dep.properties['pkg-url'] = 'http://ftp-master.debian.org/new/%s_%s.html' % (row['source'], row['version'])
# Warn about remaining information of prospective package
if (dep.desc['en'] and dep.desc['en']['short']) or dep.properties['homepage'] != HOMEPAGENONE:
@@ -1693,7 +1692,8 @@ class TaskDependencies:
status = 'pkgvcs'
dep.pkgstatus = status
dep.component = row['component']
- dep.version = [row['version']]
+ dep.properties['version'].append({'archs':'all', 'release':'VCS',
+ 'version':row['version']})
# Warn about remaining information of prospective package
if (dep.desc['en'] and dep.desc['en']['short']) or dep.properties['homepage'] != HOMEPAGENONE:
logger.info("The package %s is not yet in Debian but it is just in Blends %s Vcs. (Task %s)" % (dep.pkg, row['blend'], dep.taskname))
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index 2856d4f..1577619 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -692,9 +692,8 @@ class DependantPackage:
self.properties['Enhances'] = {} # Dictionary Enhancing pkg name as key, Link to package information as value; empty in most cases
# because Enhances relations are quite seldom
self.properties['stable_testing_version'] = [] # (release, version) tuples where release is codename for stable and testing
+ self.properties['version'] = [] # list of {'release', 'version', 'archs'} dictionary containing version and architecture information
self.vcs_found = 0 # we need a flag to store the fact whether Vcs information of a package is in UDD
- self.version = [] # list of {'release', 'version', 'archs'} dictionary containing version and architecture information
- self.outdated = {} # If not empty directory then release='upstream' and package is outdated
self.debtags = {} # list of {'tag', 'value'} dictionary containing debtag information
self.screenshots = [] # list of {'version', 'url'} dictionary containing screenshot information
self.icon = None # URL of small screenshot icon
@@ -727,8 +726,6 @@ class DependantPackage:
ret += ", releases: " + str(self.releases)
if self.component:
ret += ", component: " + self.component
- if self.version:
- ret += ", versions: " + str(self.version)
if self.desc:
ret += ", desc: " + str(self.desc)
for prop in self.properties:
@@ -736,8 +733,6 @@ class DependantPackage:
ret += ", debtags = " + str(self.debtags)
if self.icon:
ret += ", screenshoticon = " + self.icon
- if self.outdated:
- ret += ", dehsstatus = " + str(self.outdated)
# if self.desc['en']:
# ret += ", desc['en']:" + str(self.desc['en'])
@@ -1080,7 +1075,8 @@ class TaskDependencies:
dep.pkgstatus = 'official_low'
else:
dep.pkgstatus = 'new'
- dep.version = [row['version'],]
+ dep.properties['version'].append({'archs':'all', 'release':'NEW',
+ 'version':row['version']})
else:
dep.component = row['component']
# If a package is not found in main its status can be maximum non-free
@@ -1088,7 +1084,8 @@ class TaskDependencies:
elif pkg_src == 2:
dep.component = row['component']
dep.pkgstatus = 'pkgvcs'
- dep.version = [row['version'],]
+ dep.properties['version'].append({'archs':'all', 'release':'VCS',
+ 'version':row['version']})
# if a package is released *only* in experimental decrease package status
if row.get('release') == 'experimental':
@@ -1126,7 +1123,8 @@ class TaskDependencies:
for rel, ver, arch in sorted(zip(row['releases'], row['versions'],
row['architectures']),
key=lambda x: release_order[x[0]]):
- dep.version.append({
+ dep.properties['version'].append({
+ 'url': 'https://packages.debian.org/{0}/${1}'.format(rel, dep.pkg),
'release': rel,
'version': ver,
'archs': arch
@@ -1167,9 +1165,11 @@ class TaskDependencies:
# it might be that the new upstream goes to experimental - this should be ignored here
if row.get('unstable_parsed_version'):
- dep.outdated['release'] = 'upstream'
- dep.outdated['version'] = row['unstable_upstream']
- dep.outdated['architectures'] = ''
+ dep.properties['outdated'] = {
+ 'release': 'upstream',
+ 'version': row['unstable_upstream'],
+ 'architectures': 'all',
+ }
if row['changed_by']:
changed = row['changed_by']
diff --git a/webtools/templates/packages.xhtml b/webtools/templates/packages.xhtml
index 0747521..44be6c0 100644
--- a/webtools/templates/packages.xhtml
+++ b/webtools/templates/packages.xhtml
@@ -278,25 +278,27 @@ function show_fulldesc(hash) {
</a>
</td>
<td>
- <py:if test="project.version">
+ <py:if test="project.properties['version']">
<py:choose>
- <py:when test="isinstance(project.version[-1], (str, unicode))">
- ${project.version[-1]}
+ <py:when test="'url' in project.properties['version'][-1]">
+ <a href="${project.properties['version'][-1]['url']}"
+ title="Version ${project.properties['version'][-1]['version']} in ${project.properties['version'][-1]['release']}">
+ ${project.properties['version'][-1]['version']}
+ </a>
</py:when>
<py:otherwise>
- <a href="http://packages.debian.org/${project.version[-1]['release']}/${project.pkg}"
- title="Version ${project.version[-1]['version']} in ${project.version[-1]['release']}">
- ${project.version[-1]['version']}
- </a>
+ ${project.properties['version'][-1]['version']}
</py:otherwise>
</py:choose>
</py:if>
- <py:if test="project.outdated">
+ <py:if test="'outdated' in project.properties">
<a class="tooltip">
↺
<span>
New upstream version
- <strong>${project.outdated['version']}</strong>
+ <strong>
+ ${project.properties['outdated']['version']}
+ </strong>
available
</span>
</a>
@@ -435,27 +437,29 @@ function show_fulldesc(hash) {
</ul>
</dd>
</py:if>
- <py:if test="project.version != []">
+ <py:if test="project.properties['version']">
<dt>Versions</dt>
<dd>
<ul class="desc-inline">
- <py:for each="version in project.version">
- <py:choose>
- <py:when test="isinstance(version, (str, unicode))">
- <li>${version}</li>
- </py:when>
- <py:when test="'amd64' in version['archs'] or 'all' in version['archs']">
- <li>
- ${version['version']}
- (<a href="https://packages.debian.org/${version['release']}/${project.pkg}">${version['release']}</a>)
+ <py:for each="version in project.properties['version']">
+ <py:if test="'amd64' in version['archs'] or 'all' in version['archs']">
+ <li>
+ ${version['version']}
+ <py:choose>
+ <py:when test="'url' in version">
+ (<a href="${version['url']}">${version['release']}</a>)
+ </py:when>
+ <py:otherwise>
+ (${version['release']})
+ </py:otherwise>
+ </py:choose>
</li>
- </py:when>
- </py:choose>
+ </py:if>
</py:for>
- <py:if test="project.outdated">
+ <py:if test="'outdated' in project.properties">
<li>
- <strong>${project.outdated['version']}</strong>
- (${project.outdated['release']})
+ <strong>${project.properties['outdated']['version']}</strong>
+ (${project.properties['outdated']['release']})
</li>
</py:if>
</ul>
diff --git a/webtools/templates/tasks.xhtml b/webtools/templates/tasks.xhtml
index 9b53185..224a870 100644
--- a/webtools/templates/tasks.xhtml
+++ b/webtools/templates/tasks.xhtml
@@ -97,14 +97,14 @@
</div>
</td>
<td py:if="project.component and project.pkgstatus != 'new' and project.pkgstatus != 'pkgvcs'" class="project-info">
- <span py:if="project.version != []" class="tooltip" id="${project.pkg}-versions">
+ <span py:if="project.properties['version']" class="tooltip" id="${project.pkg}-versions">
<table class="versionclass">
<tr><th colspan="3" class="versionclass"><strong>Versions of package ${project.pkg}</strong></th></tr>
<tr><th class="release">Release</th><th class="version">Version</th><th class="archs">Architectures</th></tr>
- <py:for each="version in project.version">
+ <py:for each="version in project.properties['version']">
<tr><td class="release">${version['release']}</td><td class="version">${version['version']}</td><td class="archs">${version['archs']}</td></tr>
</py:for>
- <tr py:if="project.outdated != {}"><td class="outdated">${project.outdated['release']}</td><td class="outdated">${project.outdated['version']}</td>
+ <tr py:if="'outdated' in project.properties"><td class="outdated">${project.properties['outdated']['release']}</td><td class="outdated">${project.properties['outdated']['version']}</td>
</tr>
</table>
</span>
@@ -119,9 +119,9 @@
<div py:if="'popcon' in project.properties"
class="popcon"><a href="http://qa.debian.org/popcon-png.php?packages=${project.pkg}%26show_vote=on%26show_recent=on%26want_legend=on">Popcon</a>:
${project.properties['popcon']['vote']} users (${project.properties['popcon']['recent']} upd.)<sup><a href="#popconexplanation">*</a></sup></div>
- <div py:if="project.version != []">
+ <div py:if="project.properties['version']">
<div py:choose="">
- <div py:when="project.outdated == {}" class="project-info" onmouseover="TagToTip('${project.pkg}-versions', FIX, ['${project.pkg}', 0, 0])" onmouseout="UnTip()">Versions and Archs</div>
+ <div py:when="'outdated' not in project.properties" class="project-info" onmouseover="TagToTip('${project.pkg}-versions', FIX, ['${project.pkg}', 0, 0])" onmouseout="UnTip()">Versions and Archs</div>
<div py:otherwise="" class="project-infomissing" onmouseover="TagToTip('${project.pkg}-versions', FIX, ['${project.pkg}', 0, 0])" onmouseout="UnTip()">Newer upstream!</div>
</div>
</div>
@@ -151,7 +151,7 @@
</div>
</div>
<div class="language" py:if="'language' in project.properties and project.component != 'main'">Language: ${project.properties['language']}</div>
- <div py:if="project.version != [] and (project.pkgstatus == 'new' or project.pkgstatus == 'pkgvcs')">Version: ${project.version[0]}</div>
+ <div py:if="project.properties['version'] and (project.pkgstatus == 'new' or project.pkgstatus == 'pkgvcs')">Version: ${project.properties['version'][0]['version']}</div>
</td>
</tr>
<tr>
--
Static and dynamic websites for Debian Pure Blends
More information about the Blends-commit
mailing list