aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen
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
parentf37d1fcd28c9940b7f8d9bc40639d18f6ff87b5a (diff)
downloadlv2-4c606a36fbda4f8c649282f1c52d9a3bf80b3f56.tar.xz
Clean up style and terseify header.
Diffstat (limited to 'lv2specgen')
-rwxr-xr-xlv2specgen/lv2specgen.py33
-rw-r--r--lv2specgen/template.html4
2 files changed, 21 insertions, 16 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):
"""
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 @@
<div class="meta">
<table>
<tr><th class="metahead">URI</th><td><a href="@URI@">@URI@</a></td></tr>
- <tr><th class="metahead">Revision</th><td>@REVISION@</td></tr>
- <tr><th class="metahead">Namespaces</th><td>@PREFIXES@</td></tr>
+ <tr><th class="metahead">Version</th><td>@REVISION@</td></tr>
+ <tr><th class="metahead">Prefixes</th><td>@PREFIXES@</td></tr>
@AUTHORS@
</table>
</div>