aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-06-16 10:00:15 -0400
committerDavid Robillard <d@drobilla.net>2022-06-16 10:00:31 -0400
commit75111f6ff0f24e7ef683eb13963fe5c7e40d0f83 (patch)
tree12b46f42b3e132fddfd4a76a828780c5653f3344
parent4444068bc4e273b86afbab28641abe7e477af25f (diff)
downloadlv2-75111f6ff0f24e7ef683eb13963fe5c7e40d0f83.tar.xz
lv2specgen: Fix flake8 warnings
-rwxr-xr-xlv2specgen/lv2docgen.py19
1 files changed, 12 insertions, 7 deletions
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 <http://www.opensource.org/licenses/isc>'
@@ -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 '<p class="content">%s</p>' % comment
return ''
+
def port_doc(model, port):
name = model.value(port, lv2.name, None)
- comment = model.value(port, rdfs.comment, None)
html = '<div class="specterm"><h3>%s</h3>' % name
html += get_doc(model, port)
html += '</div>'
return html
+
def plugin_doc(model, plugin, style_uri):
- uri = str(plugin)
+ uri = str(plugin)
name = model.value(plugin, doap.name, None)
- html = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
+ dtd = "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"
+ html = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" %s>
<html about="%s"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:lv2="http://lv2plug.in/ns/lv2core#"
- xml:lang="en">''' % uri
+ xml:lang="en">''' % (uri, dtd)
html += '''<head>
<title>%s</title>
@@ -103,6 +107,7 @@ def plugin_doc(model, plugin, style_uri):
html += ' </body></html>'
return html
+
if __name__ == '__main__':
'LV2 plugin documentation generator'