diff options
| author | David Robillard <d@drobilla.net> | 2011-11-21 00:15:01 +0000 | 
|---|---|---|
| committer | David Robillard <d@drobilla.net> | 2011-11-21 00:15:01 +0000 | 
| commit | aab5c4605d02dc38a96b9e544ee174a90797d002 (patch) | |
| tree | 9600faa905bdbf734b5734a429788c1c38c1a33a /gendoc.py | |
| parent | 89db3c18e30b609c49ef283714c6e6a599c45c8a (diff) | |
| download | lv2-aab5c4605d02dc38a96b9e544ee174a90797d002.tar.xz | |
Bail early if there's no foo.ttl file.
Diffstat (limited to 'gendoc.py')
| -rwxr-xr-x | gendoc.py | 100 | 
1 files changed, 51 insertions, 49 deletions
| @@ -119,7 +119,11 @@ for root, dirs, files in os.walk('ns'):      bundle = root      b = os.path.basename(root) -    print("** Generating %s documentation" % outdir) +    if not os.access(outdir + '/%s.ttl' % b, os.R_OK): +        print('warning: extension %s has no %s.ttl file' % (root, root)) +        continue + +    print(" * Generating %s documentation" % outdir)      try:          model = rdflib.ConjunctiveGraph() @@ -166,54 +170,52 @@ for root, dirs, files in os.walk('ns'):      # Get short description      shortdesc = model.value(ext_node, doap.shortdesc, None) -    if (os.access(outdir + '/%s.ttl' % b, os.R_OK)): -        print(' * Running lv2specgen for %s in %s' % (b, os.getcwd())) -        specdoc = lv2specgen.specgen( -            root + '/%s.ttl' % b, -            SPECGENDIR, -            os.path.relpath(os.path.join('ns', 'doc'), abs_root), -            os.path.relpath(STYLEPATH, abs_root), -            os.path.relpath(BUILDDIR, abs_root), -            TAGFILE, -            instances=True) - -        lv2specgen.save(root + '/%s.html' % b, specdoc) - -        # Name -        row = '<tr><td><a rel="rdfs:seeAlso" href="%s">%s</a></td>' % ( -            os.path.relpath(root, 'ns'), b) - -        # Description -        if shortdesc: -            row += '<td>' + str(shortdesc) + '</td>' -        else: -            row += '<td></td>' - -        # Version -        version_str = '%s.%s' % (minor, micro) -        if minor == 0 or (micro % 2 != 0): -            row += '<td><span style="color: red">' + version_str + ' dev</span></td>' -        else: -            row += '<td>' + version_str + '</td>' - -        # Date -        row += '<td>%s</td>' % (str(date) if date else '') - -        # Status -        deprecated = model.value(ext_node, owl.deprecated, None) -        if minor == 0: -            row += '<td><span class="error">Experimental</span></td>' -        elif deprecated and str(deprecated[2]) != "false": -                row += '<td><span class="warning">Deprecated</span></td>' -        elif micro % 2 == 0: -            row += '<td><span class="success">Stable</span></td>' - -        row += '</tr>' -        extensions.append(row) - -        subst_file('../doc/htaccess.in', outdir + '.htaccess', -                   { '@NAME@': b, -                     '@BASE@': '/ns/%s/%s' % (dir, b) }) +    specdoc = lv2specgen.specgen( +        root + '/%s.ttl' % b, +        SPECGENDIR, +        os.path.relpath(os.path.join('ns', 'doc'), abs_root), +        os.path.relpath(STYLEPATH, abs_root), +        os.path.relpath(BUILDDIR, abs_root), +        TAGFILE, +        instances=True) + +    lv2specgen.save(root + '/%s.html' % b, specdoc) + +    # Name +    row = '<tr><td><a rel="rdfs:seeAlso" href="%s">%s</a></td>' % ( +        os.path.relpath(root, 'ns'), b) + +    # Description +    if shortdesc: +        row += '<td>' + str(shortdesc) + '</td>' +    else: +        row += '<td></td>' + +    # Version +    version_str = '%s.%s' % (minor, micro) +    if minor == 0 or (micro % 2 != 0): +        row += '<td><span style="color: red">' + version_str + ' dev</span></td>' +    else: +        row += '<td>' + version_str + '</td>' + +    # Date +    row += '<td>%s</td>' % (str(date) if date else '') + +    # Status +    deprecated = model.value(ext_node, owl.deprecated, None) +    if minor == 0: +        row += '<td><span class="error">Experimental</span></td>' +    elif deprecated and str(deprecated[2]) != "false": +            row += '<td><span class="warning">Deprecated</span></td>' +    elif micro % 2 == 0: +        row += '<td><span class="success">Stable</span></td>' + +    row += '</tr>' +    extensions.append(row) + +    subst_file('../doc/htaccess.in', outdir + '.htaccess', +               { '@NAME@': b, +                 '@BASE@': '/ns/%s/%s' % (dir, b) })  index_rows = ''  extensions.sort() |