From 6b353c8ae146ed5ce1c30addff6744954ed4d305 Mon Sep 17 00:00:00 2001 From: Tibor Frank Date: Mon, 23 Mar 2020 20:25:17 +0100 Subject: Report: Add RCA to comp tables For now, only these comaprison tables: - table_perf_comparison_nic - table_perf_comparison Change-Id: I52c5a960eafbe2bbf11f6c371d4a72419373dc76 Signed-off-by: Tibor Frank --- resources/tools/presentation/pal_utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'resources/tools/presentation/pal_utils.py') diff --git a/resources/tools/presentation/pal_utils.py b/resources/tools/presentation/pal_utils.py index 45fd277048..1da3350fe1 100644 --- a/resources/tools/presentation/pal_utils.py +++ b/resources/tools/presentation/pal_utils.py @@ -297,24 +297,27 @@ def classify_anomalies(data): return classification, avgs -def convert_csv_to_pretty_txt(csv_file_name, txt_file_name): +def convert_csv_to_pretty_txt(csv_file_name, txt_file_name, delimiter=u","): """Convert the given csv table to pretty text table. :param csv_file_name: The path to the input csv file. :param txt_file_name: The path to the output pretty text file. + :param delimiter: Delimiter for csv file. :type csv_file_name: str :type txt_file_name: str + :type delimiter: str """ txt_table = None with open(csv_file_name, u"rt") as csv_file: - csv_content = csv.reader(csv_file, delimiter=u',', quotechar=u'"') + csv_content = csv.reader(csv_file, delimiter=delimiter, quotechar=u'"') for row in csv_content: if txt_table is None: txt_table = prettytable.PrettyTable(row) else: txt_table.add_row(row) txt_table.align[u"Test case"] = u"l" + txt_table.align[u"RCA"] = u"l" if txt_table: with open(txt_file_name, u"wt") as txt_file: txt_file.write(str(txt_table)) -- cgit 1.2.3-korg