diff options
author | David Robillard <d@drobilla.net> | 2012-03-26 22:19:32 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-26 22:19:32 +0000 |
commit | 11173eca2f57199b57bffa20630ed795631adc26 (patch) | |
tree | cf2da0df07cc02bbea8b794ea51e3081b51c6941 | |
parent | c88b0a886429738c48e2f36a94d7588c9457cccf (diff) | |
download | lv2-11173eca2f57199b57bffa20630ed795631adc26.tar.xz |
Sort class hierarchy index at every level.
-rwxr-xr-x | lv2specgen/lv2specgen.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 54eb77b..d0ed35a 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -737,10 +737,16 @@ def buildIndex(m, classlist, proplist, instalist=None): def class_tree(c): tree = '' shown[c] = True + + subclasses = [] for s in findStatements(m, None, rdfs.subClassOf, c): - s_name = termName(m, getSubject(s)) + subclasses += [getSubject(s)] + subclasses.sort() + + for s in subclasses: + s_name = termName(m, s) tree += '<li><a href="#%s">%s</a>\n' % (s_name, s_name) - tree += class_tree(getSubject(s)) + tree += class_tree(s) tree += '</li>' if tree != '': tree = '<ul>' + tree + '</ul>' |