From 300444b23661f2ec061215766da51e6928032435 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20=C5=A0karvada?= Date: Sat, 18 Jan 2025 22:19:50 +0100 Subject: [PATCH] docs: fixed docs generation on centos-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jaroslav Škarvada --- Makefile | 2 +- compile_plugin_docs.py | 2 +- doc/manual/Makefile | 2 +- tuned/plugins/plugin_scheduler.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 652ebd4..a3819d3 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ export SBINDIR = $(PREFIX)/sbin export SYSCONFDIR = /etc export DATADIR = $(PREFIX)/share export DOCDIR = $(DATADIR)/doc/$(NAME) -PYTHON = $(BINDIR)/python3 +export PYTHON = $(BINDIR)/python3 PYLINT = pylint-3 ifeq ($(PYTHON),python2) PYLINT = pylint-2 diff --git a/compile_plugin_docs.py b/compile_plugin_docs.py index 1756205..f67c7e9 100644 --- a/compile_plugin_docs.py +++ b/compile_plugin_docs.py @@ -31,6 +31,6 @@ with open(args.out, "w") as out_file: plugin_file = inspect.getfile(plugin) plugin_name = os.path.basename(plugin_file)[7:-3] out_file.write("\n") - out_file.write(f"== **{plugin_name}**\n") + out_file.write("== **%s**\n" % plugin_name) out_file.write(inspect.cleandoc(plugin.__doc__)) out_file.write("\n") diff --git a/doc/manual/Makefile b/doc/manual/Makefile index 3fde17a..1173a4f 100644 --- a/doc/manual/Makefile +++ b/doc/manual/Makefile @@ -1,7 +1,7 @@ .PHONY: clean index.html: master.adoc assemblies/*.adoc meta/*.adoc modules/performance/*.adoc ../../tuned/plugins/plugin_*.py - python3 ../../compile_plugin_docs.py modules/performance/ref_available-tuned-plug-ins_intro.adoc modules/performance/ref_available-tuned-plug-ins.adoc + $(PYTHON) ../../compile_plugin_docs.py modules/performance/ref_available-tuned-plug-ins_intro.adoc modules/performance/ref_available-tuned-plug-ins.adoc asciidoctor -o index.html master.adoc || asciidoc -d book -o index.html master.adoc install: index.html diff --git a/tuned/plugins/plugin_scheduler.py b/tuned/plugins/plugin_scheduler.py index 4e069a2..24666e4 100644 --- a/tuned/plugins/plugin_scheduler.py +++ b/tuned/plugins/plugin_scheduler.py @@ -11,7 +11,7 @@ import threading # perf is optional try: import perf -except ModuleNotFoundError: +except ImportError: # if perf is unavailable, it will be disabled later pass import select