aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/lv2_build_index.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lv2_build_index.py')
-rwxr-xr-xscripts/lv2_build_index.py51
1 files changed, 1 insertions, 50 deletions
diff --git a/scripts/lv2_build_index.py b/scripts/lv2_build_index.py
index 9a287e4..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."
@@ -106,7 +80,7 @@ def _spec_link_columns(spec, root, name, online):
# API
col += '<td><a rel="rdfs:seeAlso"'
- col += f' href="../html/group__{stem}.html">{name}'
+ col += f' href="../c/html/group__{stem}.html">{name}'
col += "</a></td>"
return col
@@ -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,
},
)