aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-09-17 12:21:37 -0400
committerDavid Robillard <d@drobilla.net>2016-09-18 10:16:49 -0400
commite4e4eac2f2c87e68fbb6c05813ca6ac56e0a0fd7 (patch)
tree013d65c8f11d3d85e7da54dd0177c5ca49ff4dfe /lv2specgen
parent63551b0dec51012c042f263e3c8612b9cfabbb5c (diff)
downloadlv2-e4e4eac2f2c87e68fbb6c05813ca6ac56e0a0fd7.tar.xz
Fix description tables in documentation
This fixes the display of complex descriptions where properties have blank node values, and makes the output more deterministic. Most obvious in the description of params:EnvelopeControls.
Diffstat (limited to 'lv2specgen')
-rwxr-xr-xlv2specgen/lv2specgen.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index 0a77b78..d3b6606 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -558,7 +558,7 @@ def blankNodeDesc(node, m):
properties = findStatements(m, node, None, None)
doc = ''
last_pred = ''
- for p in properties:
+ for p in sorted(properties):
if isSpecial(getPredicate(p)):
continue
doc += '<tr>'
@@ -582,15 +582,11 @@ def extraInfo(term, m):
"""Generate information about misc. properties of a term"""
doc = ""
properties = findStatements(m, term, None, None)
- last_pred = None
first = True
- for p in properties:
+ for p in sorted(properties):
if isSpecial(getPredicate(p)):
- last_pred = None
continue
- if getPredicate(p) != last_pred:
- doc += '<tr><th>%s</th>\n' % getTermLink(getPredicate(p))
- first = True
+ doc += '<tr><th>%s</th>\n' % getTermLink(getPredicate(p))
if isResource(getObject(p)):
doc += getProperty(getTermLink(getObject(p), term, getPredicate(p)), first)
elif isLiteral(getObject(p)):
@@ -599,8 +595,6 @@ def extraInfo(term, m):
doc += getProperty(str(blankNodeDesc(getObject(p), m)), first)
else:
doc += getProperty('?', first)
- first = False
- last_pred = getPredicate(p)
#doc += endProperties(first)