-# 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:
"""
# 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} ' \
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} ' \
build_dir=spec.environment[u"paths"][u"DIR[BUILD,HTML]"])
execute_command(cmd)
- with open(spec.environment[u"paths"][u"DIR[CSS_PATCH_FILE]"], u"w") as \
+ with open(spec.environment[u"paths"][u"DIR[CSS_PATCH_FILE]"], u"wt") as \
css_file:
css_file.write(THEME_OVERRIDES)
- with open(spec.environment[u"paths"][u"DIR[CSS_PATCH_FILE2]"], u"w") as \
+ with open(spec.environment[u"paths"][u"DIR[CSS_PATCH_FILE2]"], u"wt") as \
css_file:
css_file.write(THEME_OVERRIDES)
plots.extend(
get_files(spec.environment[u"paths"][u"DIR[STATIC,DPDK]"], u"html")
)
+ plots.extend(
+ get_files(spec.environment[u"paths"][u"DIR[STATIC,TREX]"], 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))
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.")