From 11173eca2f57199b57bffa20630ed795631adc26 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 26 Mar 2012 22:19:32 +0000 Subject: Sort class hierarchy index at every level. --- lv2specgen/lv2specgen.py | 10 ++++++++-- 1 file 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 += '
  • %s\n' % (s_name, s_name) - tree += class_tree(getSubject(s)) + tree += class_tree(s) tree += '
  • ' if tree != '': tree = '' -- cgit v1.2.1