From 75111f6ff0f24e7ef683eb13963fe5c7e40d0f83 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 16 Jun 2022 10:00:15 -0400 Subject: lv2specgen: Fix flake8 warnings --- lv2specgen/lv2docgen.py | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'lv2specgen/lv2docgen.py') diff --git a/lv2specgen/lv2docgen.py b/lv2specgen/lv2docgen.py index d620a34..63ccdb6 100755 --- a/lv2specgen/lv2docgen.py +++ b/lv2specgen/lv2docgen.py @@ -20,7 +20,7 @@ import errno import os import sys -__date__ = '2012-03-27' +__date__ = '2012-03-27' __version__ = '0.0.0' __authors__ = 'David Robillard' __license__ = 'ISC License ' @@ -32,41 +32,45 @@ except ImportError: sys.exit('Error importing rdflib') doap = rdflib.Namespace('http://usefulinc.com/ns/doap#') -lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') -rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') +lv2 = rdflib.Namespace('http://lv2plug.in/ns/lv2core#') +rdf = rdflib.Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#') rdfs = rdflib.Namespace('http://www.w3.org/2000/01/rdf-schema#') + def uri_to_path(uri): path = uri[uri.find(':'):] while not path[0].isalpha(): path = path[1:] return path + def get_doc(model, subject): comment = model.value(subject, rdfs.comment, None) if comment: return '

%s

' % comment return '' + def port_doc(model, port): name = model.value(port, lv2.name, None) - comment = model.value(port, rdfs.comment, None) html = '

%s

' % name html += get_doc(model, port) html += '
' return html + def plugin_doc(model, plugin, style_uri): - uri = str(plugin) + uri = str(plugin) name = model.value(plugin, doap.name, None) - html = ''' + dtd = "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd" + html = ''' ''' % uri + xml:lang="en">''' % (uri, dtd) html += ''' %s @@ -103,6 +107,7 @@ def plugin_doc(model, plugin, style_uri): html += ' ' return html + if __name__ == '__main__': 'LV2 plugin documentation generator' -- cgit v1.2.1