aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen/lv2specgen.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-10 03:52:10 +0000
committerDavid Robillard <d@drobilla.net>2011-03-10 03:52:10 +0000
commit4c606a36fbda4f8c649282f1c52d9a3bf80b3f56 (patch)
tree49e23587b4225ea09ee1ba2f511ad027dcd5b0be /lv2specgen/lv2specgen.py
parentf37d1fcd28c9940b7f8d9bc40639d18f6ff87b5a (diff)
downloadlv2-4c606a36fbda4f8c649282f1c52d9a3bf80b3f56.tar.xz
Clean up style and terseify header.
Diffstat (limited to 'lv2specgen/lv2specgen.py')
-rwxr-xr-xlv2specgen/lv2specgen.py33
1 files changed, 19 insertions, 14 deletions
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 += '<div class="author" property="doap:developer">%s</div>' % 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 += '<div class="author" property="doap:maintainer">%s</div>' % m
-
- ret = ''
- if dev_str != '':
- ret += '<tr><th class="metahead">Developer(s)</th><td>' + dev_str + '</td></tr>'
- if maint_str != '':
- ret += '<tr><th class="metahead">Maintainer(s)</th><td>' + maint_str + '</td></tr>'
+ doc = ''
+ first = True
+ for d in dev:
+ if not first:
+ doc += ', '
+ doc += '<span class="author" property="doap:developer">%s</span>' % d
+ first = False
- return ret
+ for m in maint:
+ if not first:
+ doc += ', '
+ doc += '<span class="author" property="doap:maintainer">%s</span>' % m
+ first = False
+ n_authors = len(dev) + len(maint)
+ if n_authors == 0:
+ return ''
+ elif n_authors == 1:
+ return '<tr><th class="metahead">Author</th><td>' + doc + '</td></tr>'
+ else:
+ return '<tr><th class="metahead">Authors</th><td>' + doc + '</td></tr>'
def specVersion(m, subject):
"""