aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-09-08 22:53:46 -0400
committerDavid Robillard <d@drobilla.net>2022-09-09 12:55:17 -0400
commit931fe4f70b48e0f020c3f999c253009d99b860fa (patch)
tree2ac1fe4a705d6dea0e94c639f2d7b044d97a7ae1 /scripts
parentb618c88c3a2e435846472c2b17c4df549b1a47f7 (diff)
downloadlv2-931fe4f70b48e0f020c3f999c253009d99b860fa.tar.xz
Fix documentation index
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/lv2_build_index.py49
1 files changed, 0 insertions, 49 deletions
diff --git a/scripts/lv2_build_index.py b/scripts/lv2_build_index.py
index c99ba8d..6e4ebea 100755
--- a/scripts/lv2_build_index.py
+++ b/scripts/lv2_build_index.py
@@ -7,10 +7,8 @@
Write an HTML index for a set of LV2 specifications.
"""
-import datetime
import json
import os
-import time
import sys
import argparse
import subprocess
@@ -67,30 +65,6 @@ def _spec_target(spec, root, online=False):
return target if online else target + ".html"
-def _spec_date(model, spec, minor, micro):
- "Return the date for a release of a specification as an RDF node."
-
- # Get date
- date = None
- for release in model.objects(spec, doap.release):
- revision = model.value(release, doap.revision, None, any=False)
- if str(revision) == f"{minor}.{micro}":
- date = model.value(release, doap.created, None)
- break
-
- # Verify that this date is the latest
- if date is not None:
- for other_release in model.objects(spec, doap.release):
- for other_date in model.objects(other_release, doap.created):
- if other_date is None:
- _warn(f"{spec} has no doap:created date")
- elif other_date > date:
- _warn(f"{spec} {minor}.{micro} ({date}) is an old release")
- break
-
- return date
-
-
def _spec_link_columns(spec, root, name, online):
"Return the first two link columns in a spec row as an HTML string."
@@ -133,11 +107,6 @@ def index_row(model, spec, root_uri, online):
_warn(f"{spec} has no unique valid version")
return ""
- # Check that date is present and valid
- if _spec_date(model, spec, minor, micro) is None:
- _warn(f"{spec} has no doap:created date")
- return ""
-
row = "<tr>"
# Specification and API
@@ -182,34 +151,16 @@ def build_index(
model = _load_ttl(input_paths)
- # Get date for this version, and list of all LV2 distributions
- proj = rdflib.URIRef("http://lv2plug.in/ns/lv2")
- date = None
- for row in model.triples([proj, doap.release, None]):
- revision = model.value(row[2], doap.revision, None)
- created = model.value(row[2], doap.created, None)
- if str(revision) == lv2_version:
- date = created
-
- dist = model.value(row[2], doap["file-release"], None)
- if not dist or not created:
- _warn(f"{proj} has no file release")
-
rows = []
for spec in model.triples([None, rdf.type, lv2.Specification]):
rows += [index_row(model, spec[0], root_uri, online)]
- if date is None:
- now = int(os.environ.get("SOURCE_DATE_EPOCH", time.time()))
- date = datetime.datetime.utcfromtimestamp(now).strftime("%F")
-
_subst_file(
os.path.join(lv2_source_root, "doc", "index.html.in"),
sys.stdout,
{
"@ROWS@": "\n".join(sorted(rows)),
"@LV2_VERSION@": lv2_version,
- "@DATE@": date,
},
)