From ca6eae9a9071d337041aa2af8b7010a9233157bf Mon Sep 17 00:00:00 2001 From: Jeroen Baten Date: Wed, 19 Mar 2025 16:00:21 +0100 Subject: [PATCH 1/3] Fix Title underline too short error --- doc/src/user/en/14-custos.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/src/user/en/14-custos.rst b/doc/src/user/en/14-custos.rst index b3182b878..57a9aa382 100644 --- a/doc/src/user/en/14-custos.rst +++ b/doc/src/user/en/14-custos.rst @@ -1,5 +1,5 @@ Cost management -############### +################ .. _costes: .. contents:: From 2897f22aa78a55b74f46e9fca5b7fc06ee3064fd Mon Sep 17 00:00:00 2001 From: Jeroen Baten Date: Wed, 19 Mar 2025 16:02:47 +0100 Subject: [PATCH 2/3] Ported doctool from Python 2 to Python 3 --- doc/tools/doctool | 43 ++++++++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/doc/tools/doctool b/doc/tools/doctool index a0b15df7f..16b4643e2 100755 --- a/doc/tools/doctool +++ b/doc/tools/doctool @@ -1,9 +1,10 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 import sys, shlex, subprocess from optparse import OptionParser, OptionGroup from docutils.writers import latex2e import re +from functools import reduce try: import locale @@ -78,7 +79,7 @@ class DupRefsRemover(object): def handle_line(self, line): if line.startswith(".. _") and ":" in line: - r = map(lambda x: x.strip(), line[4:].split(":", 1)) + r = [x.strip() for x in line[4:].split(":", 1)] if r[0] in self.ref: # Do some sanity check if self.ref[r[0]] != r[1]: @@ -291,14 +292,14 @@ class DocTool(object): opts, args = optparser(OPT.docinfo).parse_args(list(args)) if opts.docinfo: - f = file(opts.docinfo, "rU") + f = open(opts.docinfo, "r") e = ShellEscapeRunner(sys.stdout) - map(e.handle_line, f.readlines()) + list(map(e.handle_line, f.readlines())) f.close() - print + print() - print ".. contents::" - print + print(".. contents::") + print() out = DupRefsRemover(sys.stdout) out_xlate = UnderlineXlate(out) @@ -310,47 +311,47 @@ class DocTool(object): if not name.endswith(".rst"): continue - f = file(name, "rU") - map(is_index_filename(name) and out.handle_line or out_xlate.handle_line, - filter(lambda l: ".. contents::" not in l, - f.readlines()) - ) + f = open(name, "r") + list(map(is_index_filename(name) and out.handle_line or out_xlate.handle_line, + [l for l in f.readlines() if ".. contents::" not in l] + )) f.close() - print + print() def cmd_htmlindex(self, cmd, *args): opts, args = optparser(OPT.docinfo).parse_args(list(args)) if opts.docinfo: - f = file(opts.docinfo, "rU") + f = open(opts.docinfo, "r") e = ShellEscapeRunner(sys.stdout) - map(e.handle_line, f.readlines()) + list(map(e.handle_line, f.readlines())) f.close() - print + print() args = list(args) - args.sort(str_tuple_sort) + #args.sort(key=str_tuple_sort) + args.sort() for name in args: # Skip non-RST inputs if not name.endswith(".rst") or not is_index_filename(name): continue - f = file(name, "rU") + f = open(name, "r") line = f.readline().strip() f.close() - print "#. `%s <%s.html>`__" % (line, name[:-4]) + print("#. `%s <%s.html>`__" % (line, name[:-4])) def cmd_help(self, cmd, *args): if args: self.main([args[0], args[0], "--help"]) else: - print "Available commands:" + print("Available commands:") for k in dir(self): if k.startswith("cmd_"): - print " ", k[4:].replace("_", "-") + print(" ", k[4:].replace("_", "-")) cmd_commands = cmd_help From 63de36d6ed1594d7e333b85461bc222cba825b78 Mon Sep 17 00:00:00 2001 From: Jeroen Baten Date: Wed, 19 Mar 2025 16:04:47 +0100 Subject: [PATCH 3/3] Updated package name from python-docutils to python3-docutils. --- HACKING.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HACKING.rst b/HACKING.rst index 3b81dd809..8fbec95d3 100644 --- a/HACKING.rst +++ b/HACKING.rst @@ -114,7 +114,7 @@ Fedora * Install requirements:: - # yum install git maven java-1.8.0-openjdk-devel postgresql postgresql-server python-docutils make gettext gnu-free-fonts-compat + # yum install git maven java-1.8.0-openjdk-devel postgresql postgresql-server python3-docutils make gettext gnu-free-fonts-compat .. WARNING:: Use the following command in Fedora 16 or below:: @@ -437,11 +437,11 @@ Debian/Ubuntu * Install requirements if generating HTML:: - # apt-get install make python-docutils + # apt-get install make python3-docutils * Install requirements if generating PDF:: - # apt-get install make python-docutils texlive-latex-base texlive-latex-recommended texlive-latex-extra textlive-fonts-recommended + # apt-get install make python3-docutils texlive-latex-base texlive-latex-recommended texlive-latex-extra textlive-fonts-recommended * Go to the directory where the documentation you want to generate is. For example, if you want to generate the user manual in English::