From e4e4eac2f2c87e68fbb6c05813ca6ac56e0a0fd7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 17 Sep 2016 12:21:37 -0400 Subject: 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. --- lv2specgen/lv2specgen.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'lv2specgen') 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 += '' @@ -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 += '%s\n' % getTermLink(getPredicate(p)) - first = True + doc += '%s\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) -- cgit v1.2.1