aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/generator_files.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2017-10-12 12:47:56 +0200
committerTibor Frank <tifrank@cisco.com>2017-10-18 14:39:27 +0000
commit9a89069be33f11879f8307e5b774c6e1e7afa398 (patch)
treec45f5bf8cd7c3277b6d70c353d03f445a34a9848 /resources/tools/presentation/generator_files.py
parent59eb880b002cc73cc6e8834814c2da34b2ddfd54 (diff)
CSIT-836: PDF format: Improvements in pdf layout
CSIT-837: Scope of pdf version Change-Id: Idfc9c04274c6635fbef14f87147665d31cfd7352 Signed-off-by: Tibor Frank <tifrank@cisco.com>
Diffstat (limited to 'resources/tools/presentation/generator_files.py')
-rw-r--r--resources/tools/presentation/generator_files.py23
1 files changed, 15 insertions, 8 deletions
diff --git a/resources/tools/presentation/generator_files.py b/resources/tools/presentation/generator_files.py
index 0989fc76c0..dd70c70ce7 100644
--- a/resources/tools/presentation/generator_files.py
+++ b/resources/tools/presentation/generator_files.py
@@ -68,15 +68,20 @@ def file_test_results(file_spec, input_data):
file_name = "{0}{1}".format(file_spec["output-file"],
file_spec["output-file-ext"])
rst_header = file_spec["file-header"]
- rst_include_table = ("\n.. csv-table::\n"
- " :header-rows: 1\n"
- " :widths: auto\n"
- " :align: center\n"
- " :file: {file}\n\n")
+
+ rst_include_table = ("\n.. only:: html\n\n"
+ " .. csv-table::\n"
+ " :header-rows: 1\n"
+ " :widths: auto\n"
+ " :align: center\n"
+ " :file: {file_html}\n"
+ "\n.. only:: latex\n\n"
+ "\n .. raw:: latex\n\n"
+ " \csvautolongtable{{{file_latex}}}\n\n")
logging.info(" Generating the file {0} ...".format(file_name))
- table_lst = get_files(file_spec["dir-tables"], ".csv", full_path=False)
+ table_lst = get_files(file_spec["dir-tables"], ".csv", full_path=True)
if len(table_lst) == 0:
logging.error(" No tables to include in '{0}'. Skipping.".
format(file_spec["dir-tables"]))
@@ -103,7 +108,9 @@ def file_test_results(file_spec, input_data):
if tests_in_suite(suite_name, input_data.tests(job, build)):
for tbl_file in table_lst:
if suite_name in tbl_file:
- file_handler.write(rst_include_table.
- format(file=tbl_file))
+ file_handler.write(
+ rst_include_table.format(
+ file_latex=tbl_file,
+ file_html=tbl_file.split("/")[-1]))
logging.info(" Done.")