Changeset 2111

Show
Ignore:
Timestamp:
06/14/09 16:59:15 (15 months ago)
Author:
drobilla
Message:

Emit authors (doap:maintainer).

Location:
trunk/lv2specgen
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/lv2specgen/lv2specgen.py

    r2099 r2111  
    7272            "http://purl.org/dc/elements/1.1/"              : "dc", 
    7373            "http://purl.org/dc/terms/"                     : "dct", 
    74             "http://usefulinc.com/ns/doap#"                 : "doap", 
    7574            "http://www.w3.org/2003/06/sw-vocab-status/ns#" : "status", 
    7675            "http://purl.org/rss/1.0/modules/content/"      : "content",  
     
    8786lv2 = RDF.NS('http://lv2plug.in/ns/lv2core#') 
    8887doap = RDF.NS('http://usefulinc.com/ns/doap#') 
     88foaf = RDF.NS('http://xmlns.com/foaf/0.1/') 
    8989 
    9090termdir = './doc' #TODO 
     
    150150        doc = termlink(doc) 
    151151    except: 
    152         return ""       # "<p>No detailed documentation for this term.</p>" 
     152        return "" # "<p>No detailed documentation for this term.</p>" 
    153153    return doc 
    154154 
     
    324324    if o.current(): 
    325325        res += "<dt>OWL Type:</dt><dd>DatatypeProperty</dd>\n" 
    326          
     326 
    327327    # Object Property ( owl.ObjectProperty ) 
    328328    o = m.find_statements( RDF.Statement(term, rdf.type, owl.ObjectProperty) ) 
     
    344344    if o.current(): 
    345345        res += "<dt>OWL Type:</dt><dd>SymmetricProperty</dd>\n" 
    346          
     346 
    347347    return res 
    348348 
     
    532532    return '' 
    533533 
     534def specAuthors(m, subject): 
     535    "Return an HTML description of the authors of the spec." 
     536    ret = '' 
     537    for i in m.find_statements(RDF.Statement(None, doap.maintainer, None)): 
     538        for j in m.find_statements(RDF.Statement(i.object, foaf.name, None)): 
     539            ret += '<div class="author">' + j.object.literal_value['string'] + '</div>\n' 
     540    return ret 
     541 
    534542def getInstances(model, classes, properties): 
    535543    """ 
     
    625633    template = template.replace('@MAIL@', 'devel@lists.lv2plug.in') 
    626634    template = template.replace('@COMMENT@', specProperty(m, spec_url, rdfs.comment)) 
     635    template = template.replace('@AUTHORS@', specAuthors(m, spec_url)) 
    627636     
    628637    return template 
     
    706715            usage() 
    707716 
    708         # Sestination 
     717        # Destination 
    709718        dest = args[3] 
    710719  
  • trunk/lv2specgen/template.html

    r2097 r2111  
    1717    <dt>Authors:</dt> 
    1818    <dd>@AUTHORS@</dd> 
    19     <dt>Maintainer:</dt> 
    20     <dd>@MAINTAINERS@</dd> 
    2119  </dl> 
    2220