From 4c606a36fbda4f8c649282f1c52d9a3bf80b3f56 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 Mar 2011 03:52:10 +0000 Subject: Clean up style and terseify header. --- lv2specgen/lv2specgen.py | 33 +++++++++++++++++++-------------- lv2specgen/template.html | 4 ++-- 2 files changed, 21 insertions(+), 16 deletions(-) (limited to 'lv2specgen') diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 9c3ab3d..b2df07c 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -584,27 +584,32 @@ def specAuthors(m, subject): for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): dev.add(j.object.literal_value['string']) - dev_str = '' - for d in dev: - dev_str += '
%s
' % d - maint = set() for i in m.find_statements(RDF.Statement(None, doap.maintainer, None)): for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): maint.add(j.object.literal_value['string']) - maint_str = '' - for m in maint: - maint_str += '
%s
' % m - - ret = '' - if dev_str != '': - ret += 'Developer(s)' + dev_str + '' - if maint_str != '': - ret += 'Maintainer(s)' + maint_str + '' + doc = '' + first = True + for d in dev: + if not first: + doc += ', ' + doc += '%s' % d + first = False - return ret + for m in maint: + if not first: + doc += ', ' + doc += '%s' % m + first = False + n_authors = len(dev) + len(maint) + if n_authors == 0: + return '' + elif n_authors == 1: + return 'Author' + doc + '' + else: + return 'Authors' + doc + '' def specVersion(m, subject): """ diff --git a/lv2specgen/template.html b/lv2specgen/template.html index 096d1e2..1b3111e 100644 --- a/lv2specgen/template.html +++ b/lv2specgen/template.html @@ -23,8 +23,8 @@
- - + + @AUTHORS@
URI@URI@
Revision@REVISION@
Namespaces@PREFIXES@
Version@REVISION@
Prefixes@PREFIXES@
-- cgit v1.2.1