aboutsummaryrefslogtreecommitdiffstats
path: root/resources/tools/presentation/pal_utils.py
diff options
context:
space:
mode:
authorTibor Frank <tifrank@cisco.com>2020-03-23 20:25:17 +0100
committerTibor Frank <tifrank@cisco.com>2020-03-24 14:05:46 +0100
commit6b353c8ae146ed5ce1c30addff6744954ed4d305 (patch)
tree070ae78e4a3dd6c76bc325d90ff04fb15244afe0 /resources/tools/presentation/pal_utils.py
parentbaaf9477dd51a8878f10a0763024df7c435a268c (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>
Diffstat (limited to 'resources/tools/presentation/pal_utils.py')
-rw-r--r--resources/tools/presentation/pal_utils.py7
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))