From 7768958f8691d095c7869f212cc6c2233b973228 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 5 Aug 2022 16:50:42 -0400 Subject: Fix documentation build with Python 3.7 --- lv2/core.lv2/meta.ttl | 2 ++ lv2specgen/lv2specgen.py | 4 ++-- scripts/lv2_build_index.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lv2/core.lv2/meta.ttl b/lv2/core.lv2/meta.ttl index ef30704..dd9650a 100644 --- a/lv2/core.lv2/meta.ttl +++ b/lv2/core.lv2/meta.ttl @@ -43,6 +43,8 @@ THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH R rdfs:label "Fix documentation build with meson 0.56.2." ] , [ rdfs:label "Fix lv2.h missing from installation." + ] , [ + rdfs:label "Fix documentation build with Python 3.7." ] ] ] , [ diff --git a/lv2specgen/lv2specgen.py b/lv2specgen/lv2specgen.py index 0c5a87d..5f06af3 100755 --- a/lv2specgen/lv2specgen.py +++ b/lv2specgen/lv2specgen.py @@ -148,7 +148,7 @@ def isLiteral(n): def niceName(uri): global spec_bundle if uri.startswith(spec_ns_str): - return uri.removeprefix(spec_ns_str) + return uri.replace(spec_ns_str, "") elif uri == str(rdfs.seeAlso): return "See also" @@ -823,7 +823,7 @@ def getShortName(uri): def getAnchor(uri): uri = str(uri) if uri.startswith(spec_ns_str): - return uri.removeprefix(spec_ns_str).replace("/", "_") + return uri.replace(spec_ns_str, "").replace("/", "_") else: return getShortName(uri) diff --git a/scripts/lv2_build_index.py b/scripts/lv2_build_index.py index c0e4395..39d933c 100755 --- a/scripts/lv2_build_index.py +++ b/scripts/lv2_build_index.py @@ -62,7 +62,7 @@ def _warn(message): def _spec_target(spec, root, online=False): "Return the relative link target for a specification." - target = spec.removeprefix(root) if spec.startswith(root) else spec + target = spec.replace(root, "") if spec.startswith(root) else spec return target if online else target + ".html" @@ -144,7 +144,7 @@ def index_row(model, spec, root_uri, online): row += _spec_link_columns( spec, root_uri, - model.value(spec, doap.name, None).removeprefix("LV2 "), + model.value(spec, doap.name, None).replace("LV2 ", ""), online, ) -- cgit v1.2.1