From 701bb484e5571cd368f04cc80ef74248f7e72959 Mon Sep 17 00:00:00 2001 From: "Roscoe A. Bartlett" Date: Wed, 9 Oct 2024 09:17:09 -0600 Subject: [PATCH] Revert "Assume standard Python3/pip3 install of docutils (#610)" This reverts commit 31bfe439037fa73c16dfa523acdae21b28f20a82. Turns out that on some RHEL8 machines, 'rst2thml' is installed, but not 'rst2html.py'. For example, for the hpws machines at SNL, /usr/bin/rst2html is installed with version: $ rst2html --version rst2html (Docutils 0.14, Python 3.6.8, on linux) So this logic looking for 'rst2thml' and 'rst2html.py' is still useful. --- tribits/python_utils/GenerateDocUtilsOutput.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tribits/python_utils/GenerateDocUtilsOutput.py b/tribits/python_utils/GenerateDocUtilsOutput.py index cb2437d7a..0eb02ef6e 100644 --- a/tribits/python_utils/GenerateDocUtilsOutput.py +++ b/tribits/python_utils/GenerateDocUtilsOutput.py @@ -39,9 +39,13 @@ def generateFile(filePath, generateCmnd, outFile=None, workingDir="", def addCmndLineOptions(clp): - # Assume standard install of docutils with Python3 - rst2html = "rst2html.py" - rst2latex = "rst2latex.py" + # Find the right default for the current system + rst2html = "rst2html" + rst2latex = "rst2latex" + rst2htmlWhich = getCmndOutput("which rst2html", True, False) + if rst2htmlWhich == "" or re.match(".+no rst2html.+", rst2htmlWhich): + rst2html = rst2html+".py" + rst2latex = rst2latex+".py" clp.add_option( "--file-base", dest="fileBase", type="string",