Changeset 2099
- Timestamp:
- 06/13/09 07:37:01 (15 months ago)
- Files:
-
- 1 modified
-
trunk/lv2specgen/lv2specgen.py (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/lv2specgen/lv2specgen.py
r2098 r2099 77 77 "http://www.w3.org/2003/01/geo/wgs84_pos#" : "geo", 78 78 "http://www.w3.org/2004/02/skos/core#" : "skos", 79 "http://lv2plug.in/ns/lv2core#" : "lv2" 79 "http://lv2plug.in/ns/lv2core#" : "lv2", 80 "http://usefulinc.com/ns/doap#" : "doap" 80 81 } 81 82 … … 85 86 vs = RDF.NS('http://www.w3.org/2003/06/sw-vocab-status/ns#') 86 87 lv2 = RDF.NS('http://lv2plug.in/ns/lv2core#') 88 doap = RDF.NS('http://usefulinc.com/ns/doap#') 87 89 88 90 termdir = './doc' #TODO … … 368 370 curie = "%s:%s" % (nspre, t) 369 371 370 doc += """<div class="specterm" id="term_%s">\n<h3>%s: %s</h3>\n""" % (t, category, curie)371 372 try: 372 373 term_uri = term.uri 373 374 except: 374 375 term_uri = term 375 doc += """<p style="font-family:monospace; font-size:0.em;">URI: <a href="%s">%s</a></p>""" % (term_uri, term_uri) 376 377 doc += """<div class="specterm" id="term_%s">\n<h3>%s: <a href="%s">%s</a></h3>\n""" % (t, category, term_uri, curie) 378 376 379 label, comment = get_rdfs(m, term) 377 380 status = get_status(m, term) … … 522 525 return classlist, proplist 523 526 527 def specProperty(m, subject, predicate): 528 "Return the rdfs:comment of the spec." 529 for c in m.find_statements(RDF.Statement(None, predicate, None)): 530 if str(c.subject.uri) == str(subject): 531 return str(c.object) 532 return '' 533 524 534 def getInstances(model, classes, properties): 525 535 """ … … 608 618 (os.path.basename(specloc), os.path.basename(sys.argv[0]), time.strftime('%X %x %Z'))) 609 619 610 template = template.replace('@NAME@', 'LV2 Port Groups')620 template = template.replace('@NAME@', specProperty(m, spec_url, doap.name)) 611 621 template = template.replace('@URI@', spec_url) 612 622 template = template.replace('@PREFIX@', spec_pre) … … 614 624 template = template.replace('@FILENAME@', os.path.basename(specloc)) 615 625 template = template.replace('@MAIL@', 'devel@lists.lv2plug.in') 626 template = template.replace('@COMMENT@', specProperty(m, spec_url, rdfs.comment)) 616 627 617 628 return template
