Line length: Fix recent merges
[csit.git] / resources / tools / presentation / generator_report.py
index 0712b78..cd6f506 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2018 Cisco and/or its affiliates.
+# Copyright (c) 2021 Cisco and/or its affiliates.
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at:
@@ -87,7 +87,7 @@ THEME_OVERRIDES = u"""/* override table width restrictions */
 """
 
 # Command to build the html format of the report
-HTML_BUILDER = u'sphinx-build -v -c . -a ' \
+HTML_BUILDER = u'sphinx-build -v -c sphinx_conf/report -a ' \
                u'-b html -E ' \
                u'-t html ' \
                u'-D release={release} ' \
@@ -96,7 +96,7 @@ HTML_BUILDER = u'sphinx-build -v -c . -a ' \
                u'{build_dir}/'
 
 # Command to build the pdf format of the report
-PDF_BUILDER = u'sphinx-build -v -c . -a ' \
+PDF_BUILDER = u'sphinx-build -v -c sphinx_conf/report -a ' \
               u'-b latex -E ' \
               u'-t latex ' \
               u'-D release={release} ' \
@@ -195,8 +195,10 @@ def generate_pdf_report(release, spec, report_week):
     plots.extend(
         get_files(spec.environment[u"paths"][u"DIR[STATIC,DPDK]"], u"html")
     )
+    pdf_plots = list()
     for plot in plots:
         file_name = f"{plot.rsplit(u'.', 1)[0]}.pdf"
+        pdf_plots.append(file_name)
         logging.info(f"Converting {plot} to {file_name}")
         execute_command(convert_plots.format(html=plot, pdf=file_name))
 
@@ -224,6 +226,10 @@ def generate_pdf_report(release, spec, report_week):
     for cmd in cmds:
         execute_command(cmd)
 
+    # Delete temporary pdf files:
+    for plot in pdf_plots:
+        execute_command(f"rm {plot}")
+
     logging.info(u"  Done.")