aboutsummaryrefslogtreecommitdiffstats
path: root/lv2specgen/lv2specgen.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-24 00:55:35 +0000
committerDavid Robillard <d@drobilla.net>2014-01-24 00:55:35 +0000
commit1cb9f77d07c998108d0ba54811ac4604a2b49725 (patch)
tree9816ff3058bcc18af86cb785bdac4857c1000181 /lv2specgen/lv2specgen.py
parentc12e45895f93e7bf3b42c43cf45208b28208a252 (diff)
downloadlv2-1cb9f77d07c998108d0ba54811ac4604a2b49725.tar.xz
atom: Deprecate Blank and Resource in favour of just Object.
atom: Add lv2_atom_forge_is_object_type() and lv2_atom_forge_is_blank() to ease backwards compatibility. atom: Add lv2_atom_forge_key() for terser object writing. patch: Add patch:sequenceNumber for associating replies with requests. lv2specgen: Display deprecated warning on classes marked owl:deprecated.
Diffstat (limited to 'lv2specgen/lv2specgen.py')
-rwxr-xr-xlv2specgen/lv2specgen.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py
index b33233c..3040049 100755
--- a/lv2specgen/lv2specgen.py
+++ b/lv2specgen/lv2specgen.py
@@ -634,6 +634,9 @@ def owlInfo(term, m):
return res
+def isDeprecated(m, subject):
+ deprecated = findOne(m, subject, owl.deprecated, None)
+ return deprecated and (str(deprecated[2]).find("true") >= 0)
def docTerms(category, list, m, classlist, proplist, instalist):
"""
@@ -665,18 +668,22 @@ def docTerms(category, list, m, classlist, proplist, instalist):
label = getLabel(m, term)
comment = getComment(m, term, classlist, proplist, instalist)
+ is_deprecated = isDeprecated(m, term)
doc += '<div class="spectermbody">'
- if label != '' or comment != '':
+ if label != '' or comment != '' or is_deprecated:
doc += '<div class="description">'
if label != '':
doc += "<div property=\"rdfs:label\" class=\"label\">%s</div>" % label
+ if is_deprecated:
+ doc += '<div class="warning">DEPRECATED</div>'
+
if comment != '':
doc += "<div property=\"rdfs:comment\">%s</div>" % comment
- if label != '' or comment != '':
+ if label != '' or comment != '' or is_deprecated:
doc += "</div>"
terminfo = ""
@@ -1173,8 +1180,7 @@ def specgen(specloc, indir, style_uri, docdir, tags, opts, instances=False, offl
if experimental:
version_string += ' <span class="warning">EXPERIMENTAL</span>'
- deprecated = findOne(m, rdflib.URIRef(spec_url), owl.deprecated, None)
- if deprecated and str(deprecated[2]).find("true") > 0:
+ if isDeprecated(m, rdflib.URIRef(spec_url)):
version_string += ' <span class="warning">DEPRECATED</span>'
template = template.replace('@REVISION@', version_string)