From 7ea2b2bf56cfd5c4c8abfe8674ccda3c7e179132 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Dec 2013 01:01:56 +0000 Subject: lv2specgen: Fix links to externally defined terms. --- lv2/lv2plug.in/ns/meta/meta.ttl | 4 +++- lv2specgen/lv2specgen.py | 20 ++++++++++---------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/lv2/lv2plug.in/ns/meta/meta.ttl b/lv2/lv2plug.in/ns/meta/meta.ttl index 94c8dd5..a88345d 100644 --- a/lv2/lv2plug.in/ns/meta/meta.ttl +++ b/lv2/lv2plug.in/ns/meta/meta.ttl @@ -48,12 +48,14 @@ THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH R meta:kfoltman , meta:paniq ; doap:release [ - doap:revision "1.6.1" ; + doap:revision "1.6.2" ; doap:created "2013-10-15" ; dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Add scope example plugin from Robin Gareus." + ] , [ + rdfs:label "lv2specgen: Fix links to externally defined terms." ] ] ] , [ diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index efbf053..4ea301a 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -726,6 +726,13 @@ def buildIndex(m, classlist, proplist, instalist=None): azlist = '
' + def termLink(m, t): + if str(t).startswith(spec_ns_str): + name = termName(m, t) + return '%s' % (name, name) + else: + return '%s' % (str(t), str(t)) + if (len(classlist) > 0): azlist += "
Classes
    " classlist.sort() @@ -744,10 +751,7 @@ def buildIndex(m, classlist, proplist, instalist=None): continue shown[c] = True - name = termName(m, c) - if name.startswith(spec_ns_str): - name = name.split(spec_ns_str[-1])[1] - azlist += '
  • %s' % (name, name) + azlist += '
  • ' + termLink(m, c) def class_tree(c): tree = '' shown[c] = True @@ -758,8 +762,7 @@ def buildIndex(m, classlist, proplist, instalist=None): subclasses.sort() for s in subclasses: - s_name = termName(m, s) - tree += '
  • %s\n' % (s_name, s_name) + tree += '
  • ' + termLink(m, s) tree += class_tree(s) tree += '
  • ' if tree != '': @@ -774,10 +777,7 @@ def buildIndex(m, classlist, proplist, instalist=None): proplist.sort() props = [] for p in proplist: - name = termName(m, p) - if name.startswith(spec_ns_str): - name = name.split(spec_ns_str[-1])[1] - props += ['%s' % (name, name)] + props += [termLink(m, p)] azlist += ', '.join(props) + '
\n' if (instalist != None and len(instalist) > 0): -- cgit v1.2.1