Skip to content
Snippets Groups Projects
Commit 56c5690b authored by Steffen Hauf's avatar Steffen Hauf
Browse files

Fix sphinx formatting issues

parent 73495076
No related branches found
No related tags found
1 merge request!47Fixes from webservices
...@@ -108,22 +108,24 @@ def make_report(run_path, tmp_path, out_path, project, author, version, report_t ...@@ -108,22 +108,24 @@ def make_report(run_path, tmp_path, out_path, project, author, version, report_t
if isfile("{}/{}".format(run_path, entry)): if isfile("{}/{}".format(run_path, entry)):
name, ext = splitext("{}".format(entry)) name, ext = splitext("{}".format(entry))
if ext == ".rst" and "index" not in name: if ext == ".rst" and "index" not in name:
files_to_handle.append(name) files_to_handle.append(name.strip())
with open("{}/index.rst.tmp".format(run_path), "w") as mf: with open("{}/index.rst.tmp".format(run_path), "w") as mf:
with open("{}/index.rst".format(run_path), "r") as mfr: with open("{}/index.rst".format(run_path), "r") as mfr:
indexTmp = Template(''' indexTmp = Template('''
.. toctree:: .. toctree::
:maxdepth: 2 :maxdepth: 2
{% for k in keys %} {% for k in keys %}
{{ k }} {{ k }}
{%- endfor %} {%- endfor %}
''') ''')
for line in mfr: for line in mfr:
line = line.replace(".. toctree::", textwrap.dedent( line = line.replace(".. toctree::", textwrap.dedent(
indexTmp.render(keys=files_to_handle))) indexTmp.render(keys=files_to_handle)))
line = line.replace(":maxdepth: 2", "") line = line.replace(":maxdepth: 2", "")
line = line.replace("Documentation", "Calibration") line = line.replace("Documentation", "Calibration")
if ":caption." in line:
continue
mf.write(line) mf.write(line)
cdir = os.getcwd() cdir = os.getcwd()
...@@ -147,7 +149,7 @@ def make_report(run_path, tmp_path, out_path, project, author, version, report_t ...@@ -147,7 +149,7 @@ def make_report(run_path, tmp_path, out_path, project, author, version, report_t
print(f) print(f)
shutil.copy(f, out_path) shutil.copy(f, out_path)
print("Removing temporary files at: {}".format(tmp_path)) print("Removing temporary files at: {}".format(tmp_path))
# shutil.rmtree(tmp_path) shutil.rmtree(tmp_path)
def finalize(joblist, run_path, out_path, project, calibration, author, version, report_to): def finalize(joblist, run_path, out_path, project, calibration, author, version, report_to):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment