[Blends-commit] [SCM] website branch, master, updated. 1bc06676f66579fdbad9c099022f1d2ad495b00a
Ole Streicher
ole at aip.de
Thu Mar 17 16:02:47 UTC 2016
The following commit has been merged in the master branch:
commit 02c2a389777d051eb0610f32c9004e7c8d010558
Author: Ole Streicher <ole at aip.de>
Date: Thu Mar 17 15:44:53 2016 +0100
Separate email from name for maintainer and uploader
This replaces the formatted versions for text and HTML by the fields
maintainer_email and maintainer_name resp. uploader_email and
uploader_name. Formatting is done during genshi output.
This removes one reason to use genshi.Markup()
diff --git a/webtools/blendstasktools.py b/webtools/blendstasktools.py
index 9f75d4a..78c1bc5 100644
--- a/webtools/blendstasktools.py
+++ b/webtools/blendstasktools.py
@@ -748,8 +748,6 @@ class DependantPackage:
self.screenshots = [] # list of {'version', 'url'} dictionary containing screenshot information
self.icon = None # URL of small screenshot icon
self.screenshot_url = None # URL to screenshots.debian.net
- self.responsible = None # E-Mail address of issuer of ITP or some person
- # who volunteered to care for this program
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)
@@ -994,8 +992,10 @@ class Tasks:
'name': tdep.pkg,
'debian_version': tdep.version[-1]['version'],
'upstream_version': tdep.outdated['version'],
- 'maintainer': tdep.properties['maintainer'],
- 'uploader': tdep.properties.get('last_uploader_simple')
+ 'maintainer_name': tdep.properties.get('maintainer_name'),
+ 'maintainer_email': tdep.properties.get('maintainer_email'),
+ 'uploader_name': tdep.properties.get('uploader_name'),
+ 'uploader_email': tdep.properties.get('uploader_email'),
})
if pkgList:
ret[task] = pkgList
@@ -1204,16 +1204,17 @@ class TaskDependencies:
# Make sure there is really enough information to deal with provided by the package
logger.error("Missing package information for field %s = %s in task file %s" % (key, responsible, self.task))
continue
- if dep.responsible is not None:
+ if 'maintainer_email' in dep.properties:
# we are dealing with an official package that has a real maintainer who
# is finally responsible
# ... but do not issue a hint about this in the logs. Sometimes a responsible
# person makes sense in the tasks field
# fields_obsolete.append(key)
continue
- if responsible != '':
- (_name, _url) = email.Utils.parseaddr(responsible)
- dep.responsible = '<a href="mailto:%s">%s</a>' % (_url, _name)
+ if responsible:
+ (_name, _url) = email.utils.parseaddr(responsible)
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
continue
if key in dep_strength_keys:
@@ -1244,7 +1245,11 @@ class TaskDependencies:
dep = DependantPackage(self.blendname, self.task)
# Store the comments in case they might be usefull for later applications
dep.why = why
- dep.responsible = responsible
+ if responsible:
+ (_name, _url) = email.utils.parseaddr(responsible)
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
+
dep.dep_strength = key
if dep_in_line.islower():
dep.pkg = dep_in_line
@@ -1592,10 +1597,8 @@ class TaskDependencies:
changed = row['changed_by']
if changed:
(_name, _url) = email.utils.parseaddr(changed)
- changed = '<a href="mailto:%s">%s</a>' % (_url, _name)
- dep.properties['changed_by'] = Markup(changed)
- dep.properties['last_uploader'] = changed
- dep.properties['last_uploader_simple'] = '%s <%s>' % (_name, _url)
+ dep.properties['uploader_name'] = _name
+ dep.properties['uploader_email'] = _url
# link to packages.debian.org search page to see overview about all
# package versions in all releases
@@ -1611,9 +1614,10 @@ class TaskDependencies:
logger.error("Dep has no English short description: %s", dep.pkg)
dep.desc['en']['short'] = "??? missing short description for package %s :-(" % dep.pkg
- (_name, _url) = email.Utils.parseaddr(row['maintainer'])
- dep.properties['maintainer'] = row['maintainer']
- dep.responsible = '<a href="mailto:%s">%s</a>' % (_url, _name)
+ if row['maintainer']:
+ (_name, _url) = email.utils.parseaddr(row['maintainer'])
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
if row.get('edam_topics'):
logger.info("Edam topics found for package %s: %s" % (dep.pkg, str(row['edam_topics'])))
@@ -1666,8 +1670,11 @@ class TaskDependencies:
dep.properties[prop] = row[prop]
dep.desc['en']['short'] = Markup(row['description_en'])
dep.desc['en']['long'] = Markup(render_longdesc(row['long_description_en'].splitlines()))
- (_name, _url) = email.Utils.parseaddr(row['maintainer'])
- dep.responsible = '<a href="mailto:%s">%s</a>' % (_url, _name)
+ if row['maintainer']:
+ (_name, _url) = email.utils.parseaddr(row['maintainer'])
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
+
dep.SetPublications(row)
if row['changed_by']:
try:
@@ -1676,11 +1683,9 @@ class TaskDependencies:
changed = None
logger.warning("Encoding problem for uploader to ftpnew of package '%s' in task %s (%s)" % (dep.pkg, dep.taskname, err))
if changed:
- (_name, _url) = email.Utils.parseaddr(changed)
- changed = '<a href="mailto:%s">%s</a>' % (_url, _name)
- dep.properties['changed_by'] = Markup(changed)
- dep.properties['last_uploader'] = changed
- dep.properties['last_uploader_simple'] = '%s <%s>' % (_name, _url)
+ (_name, _url) = email.utils.parseaddr(changed)
+ dep.properties['uploader_name'] = _name
+ dep.properties['uploader_email'] = _url
# Verify whether there are virtual packages which are provided by some other packages in the list of dependencies
query = "EXECUTE query_provides('%s')" % List2PgArray(pkgs_in_pool)
@@ -1750,8 +1755,11 @@ class TaskDependencies:
dep.SetPublications(row)
dep.desc['en']['short'] = Markup(row['description_en'])
dep.desc['en']['long'] = Markup(render_longdesc(row['long_description_en'].splitlines()))
- (_name, _url) = email.Utils.parseaddr(row['maintainer'])
- dep.responsible = '<a href="mailto:%s">%s</a>' % (_url, _name)
+ if row['maintainer']:
+ (_name, _url) = email.utils.parseaddr(row['maintainer'])
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
+
if row['changed_by']:
try:
changed = row['changed_by']
@@ -1759,11 +1767,9 @@ class TaskDependencies:
changed = None
logger.warning("Encoding problem for changelog author in Vcs of package '%s' in task %s (%s)" % (dep.pkg, dep.taskname, err))
if changed:
- (_name, _url) = email.Utils.parseaddr(changed)
- changed = '<a href="mailto:%s">%s</a>' % (_url, _name)
- dep.properties['changed_by'] = Markup(changed)
- dep.properties['last_uploader'] = changed
- dep.properties['last_uploader_simple'] = '%s <%s>' % (_name, _url)
+ (_name, _url) = email.utils.parseaddr(changed)
+ dep.properties['uploader_name'] = _name
+ dep.properties['uploader_email'] = _url
# Verify whether packages which are neither in pool, new, vcs nor virtual have sufficient information in task file
for status in self.dependencies.keys():
@@ -1890,7 +1896,10 @@ class TaskDependencies:
dep = DependantPackage(self.blendname, self.task)
# Store the comments in case they might be usefull for later applications
dep.why = why
- dep.responsible = responsible
+ if responsible:
+ (_name, _url) = email.utils.parseaddr(responsible)
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
dep.dep_strength = key
dep.pkg = virt_provides
dep._QueryUDD4Package(source)
@@ -1906,7 +1915,6 @@ class TaskDependencies:
for dependency in self.dependencies.values():
for dep in dependency:
- dep.responsible = Markup(dep.responsible)
if dep.desc['en'] != {}:
dep.desc['en']['short'] = Markup(dep.desc['en']['short'])
try:
@@ -2023,7 +2031,6 @@ class PackageBugs:
self.source = pkgdict['source']
self.homepage = pkgdict['homepage']
self.vcsbrowser = pkgdict['vcs-browser']
- self.maintainer = Markup(pkgdict['maintainer'])
self.bugs = [] # open bugs
self.nbugs = 0
self.severities = {}
diff --git a/webtools/blendstasktools_udd.py b/webtools/blendstasktools_udd.py
index 88e40c3..de7520a 100644
--- a/webtools/blendstasktools_udd.py
+++ b/webtools/blendstasktools_udd.py
@@ -704,8 +704,6 @@ class DependantPackage:
self.screenshots = [] # list of {'version', 'url'} dictionary containing screenshot information
self.icon = None # URL of small screenshot icon
self.screenshot_url = None # URL to screenshots.debian.net
- self.responsible = None # E-Mail address of issuer of ITP or some person
- # who volunteered to care for this program
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)
@@ -1198,10 +1196,8 @@ class TaskDependencies:
changed = row['changed_by']
if changed:
(_name, _url) = email.utils.parseaddr(changed)
- changed = '<a href="mailto:%s">%s</a>' % (_url, _name)
- dep.properties['changed_by'] = Markup(changed)
- dep.properties['last_uploader'] = (changed)
- dep.properties['last_uploader_simple'] = ('%s <%s>' % (_name, _url))
+ dep.properties['uploader_name'] = _name
+ dep.properties['uploader_email'] = _url
# link to packages.debian.org search page to see overview about all
# package versions in all releases
@@ -1218,8 +1214,8 @@ class TaskDependencies:
dep.desc['en']['short'] = "??? missing short description for package %s :-(" % dep.pkg
(_name, _url) = email.utils.parseaddr(row['maintainer'])
- dep.properties['maintainer'] = (row['maintainer'])
- dep.responsible = '<a href="mailto:%s">%s</a>' % (_url, (_name))
+ dep.properties['maintainer_name'] = _name
+ dep.properties['maintainer_email'] = _url
if row.get('edam_topics'):
logger.info("Edam topics found for package %s: %s" % (dep.pkg, str(row['edam_topics'])))
@@ -1338,7 +1334,6 @@ class TaskDependencies:
for dependency in self.dependencies.values():
for dep in dependency:
- dep.responsible = Markup(dep.responsible)
if dep.desc['en'] != {}:
dep.desc['en']['short'] = Markup(dep.desc['en']['short'])
try:
diff --git a/webtools/new_upstream.py b/webtools/new_upstream.py
index b56e3b2..d52ca7d 100755
--- a/webtools/new_upstream.py
+++ b/webtools/new_upstream.py
@@ -25,9 +25,9 @@ for task in packages.keys():
printstring = '\t{name}:\n'
printstring += '\t\tHighest version in Debian is {debian_version}\n'
printstring += '\t\tUpstream has {upstream_version}\n'
- printstring += '\t\tMaintainer is {maintainer}'
- if 'uloader' in pkg_v_o:
- printstring += '\n\t\tLast uploader was {uploader}'
+ printstring += '\t\tMaintainer is {maintainer_name} <{maintainer_email}>'
+ if 'uloader_name' in pkg_v_o:
+ printstring += '\n\t\tLast uploader was {uploader_name} <{uploader_email}>'
print(printstring.format(**pkg_v_o))
# Perhaps we should also send a mail to pts at qa.debian.org
diff --git a/webtools/templates/packages.xhtml b/webtools/templates/packages.xhtml
index fd2764d..7f0ed90 100644
--- a/webtools/templates/packages.xhtml
+++ b/webtools/templates/packages.xhtml
@@ -422,13 +422,13 @@ function show_fulldesc(hash) {
</ul>
</dd>
</py:if>
- <py:if test="project.responsible != None">
+ <py:if test="'maintainer_email' in project.properties">
<dt>${maintainer[pstatus]}</dt>
<dd>
<ul class="desc-inline">
- <li>${project.responsible}</li>
- <py:if test="project.properties.get('changed_by')">
- <li>${project.properties['changed_by']}</li>
+ <li><a href="mailto:${project.properties['maintainer_email']}">${project.properties['maintainer_name']}</a></li>
+ <py:if test="'uploader_email' in project.properties">
+ <li><a href="mailto:${project.properties['uploader_email']}">${project.properties['uploader_name']}</a></li>
</py:if>
</ul>
</dd>
diff --git a/webtools/templates/tasks.xhtml b/webtools/templates/tasks.xhtml
index 61963b8..d7e2577 100644
--- a/webtools/templates/tasks.xhtml
+++ b/webtools/templates/tasks.xhtml
@@ -90,8 +90,8 @@
<span py:when="'#'">${nohomepage}</span>
<span py:otherwise=""><a href="${project.properties['homepage']}">${project.properties['homepage']}</a></span>
</div>
- <div py:if="project.responsible != None">${maintainer[pstatus]}:
- ${project.responsible} <span py:if="'changed_by' in project.properties">(${project.properties['changed_by']})</span>
+ <div py:if="'maintainer_email' in project.properties">${maintainer[pstatus]}:
+ <a href="mailto:${project.properties['maintainer_email']}">${project.properties['maintainer_name']}</a> <span py:if="'uploader_email' in project.properties">(<a href="mailto:${project.properties['uploader_email']}">${project.properties['uploader_name']}</a>)</span>
</div>
</td>
<td py:if="project.component and project.pkgstatus != 'new' and project.pkgstatus != 'pkgvcs'" class="project-info">
--
Static and dynamic websites for Debian Pure Blends
More information about the Blends-commit
mailing list