diff options
author | Tibor Frank <tifrank@cisco.com> | 2020-03-23 20:25:17 +0100 |
---|---|---|
committer | Tibor Frank <tifrank@cisco.com> | 2020-03-24 13:07:34 +0000 |
commit | 063c97d6607c1cc61a8cd129a37cca0dee6d4df8 (patch) | |
tree | 0244b87c4eb30139e44380c279daa2ebcd1a1c77 /resources/tools/presentation/pal_utils.py | |
parent | 9959ab2ff0122d0c6c7523ab9d4241b271098845 (diff) |
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 <tifrank@cisco.com>
(cherry picked from commit 6b353c8ae146ed5ce1c30addff6744954ed4d305)
Diffstat (limited to 'resources/tools/presentation/pal_utils.py')
-rw-r--r-- | resources/tools/presentation/pal_utils.py | 7 |
1 files changed, 5 insertions, 2 deletions
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)) |