Skip to content

Commit 48c149b

Browse files
author
Cruz Monrreal
authored
Merge pull request #7720 from jeromecoutant/PR_PRETTYTABLE
python scripts : table print with github policy
2 parents 2ec889f + a42c73d commit 48c149b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

tools/build_api.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
11611161
release_version - get the matrix for this major version number
11621162
"""
11631163
# Only use it in this function so building works without extra modules
1164-
from prettytable import PrettyTable
1164+
from prettytable import PrettyTable, HEADER
11651165
release_version = _lowercase_release_version(release_version)
11661166
version_release_targets = {}
11671167
version_release_target_names = {}
@@ -1183,7 +1183,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
11831183

11841184
# All tests status table print
11851185
columns = prepend_columns + unique_supported_toolchains
1186-
table_printer = PrettyTable(columns)
1186+
table_printer = PrettyTable(columns, junction_char="|", hrules=HEADER)
11871187
# Align table
11881188
for col in columns:
11891189
table_printer.align[col] = "c"
@@ -1271,10 +1271,10 @@ def print_build_memory_usage(report):
12711271
Positional arguments:
12721272
report - Report generated during build procedure.
12731273
"""
1274-
from prettytable import PrettyTable
1274+
from prettytable import PrettyTable, HEADER
12751275
columns_text = ['name', 'target', 'toolchain']
12761276
columns_int = ['static_ram', 'total_flash']
1277-
table = PrettyTable(columns_text + columns_int)
1277+
table = PrettyTable(columns_text + columns_int, junction_char="|", hrules=HEADER)
12781278

12791279
for col in columns_text:
12801280
table.align[col] = 'l'

tools/memap.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from argparse import ArgumentParser
2020
from copy import deepcopy
2121
from collections import defaultdict
22-
from prettytable import PrettyTable
22+
from prettytable import PrettyTable, HEADER
2323
from jinja2 import FileSystemLoader, StrictUndefined
2424
from jinja2.environment import Environment
2525

@@ -726,7 +726,7 @@ def generate_table(self, file_desc):
726726
columns = ['Module']
727727
columns.extend(self.print_sections)
728728

729-
table = PrettyTable(columns)
729+
table = PrettyTable(columns, junction_char="|", hrules=HEADER)
730730
table.align["Module"] = "l"
731731
for col in self.print_sections:
732732
table.align[col] = 'r'

tools/test_api.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
import ctypes
3333
import functools
3434
from colorama import Fore, Back, Style
35-
from prettytable import PrettyTable
35+
from prettytable import PrettyTable, HEADER
3636
from copy import copy, deepcopy
3737

3838
from time import sleep, time
@@ -766,7 +766,7 @@ def generate_test_summary_by_target(self, test_summary, shuffle_seed=None):
766766
result_dict[test[TEST_INDEX]][test[TOOLCHAIN_INDEX]] = test[RESULT_INDEX]
767767

768768
pt_cols = ["Target", "Test ID", "Test Description"] + unique_target_toolchains
769-
pt = PrettyTable(pt_cols)
769+
pt = PrettyTable(pt_cols, junction_char="|", hrules=HEADER)
770770
for col in pt_cols:
771771
pt.align[col] = "l"
772772
pt.padding_width = 1 # One space between column edges and contents (default)
@@ -794,7 +794,7 @@ def generate_test_summary(self, test_summary, shuffle_seed=None):
794794
result = "Test summary:\n"
795795
# Pretty table package is used to print results
796796
pt = PrettyTable(["Result", "Target", "Toolchain", "Test ID", "Test Description",
797-
"Elapsed Time (sec)", "Timeout (sec)", "Loops"])
797+
"Elapsed Time (sec)", "Timeout (sec)", "Loops"], junction_char="|", hrules=HEADER)
798798
pt.align["Result"] = "l" # Left align
799799
pt.align["Target"] = "l" # Left align
800800
pt.align["Toolchain"] = "l" # Left align
@@ -1328,7 +1328,7 @@ def print_muts_configuration_from_json(json_data, join_delim=", ", platform_filt
13281328

13291329
# Prepare pretty table object to display all MUTs
13301330
pt_cols = ["index"] + muts_info_cols
1331-
pt = PrettyTable(pt_cols)
1331+
pt = PrettyTable(pt_cols, junction_char="|", hrules=HEADER)
13321332
for col in pt_cols:
13331333
pt.align[col] = "l"
13341334

@@ -1366,7 +1366,7 @@ def print_test_configuration_from_json(json_data, join_delim=", "):
13661366

13671367
# Prepare pretty table object to display test specification
13681368
pt_cols = ["mcu"] + sorted(toolchains_info_cols)
1369-
pt = PrettyTable(pt_cols)
1369+
pt = PrettyTable(pt_cols, junction_char="|", hrules=HEADER)
13701370
for col in pt_cols:
13711371
pt.align[col] = "l"
13721372

@@ -1455,7 +1455,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','
14551455
'duration'] if cols is None else cols
14561456

14571457
# All tests status table print
1458-
pt = PrettyTable(test_properties)
1458+
pt = PrettyTable(test_properties, junction_char="|", hrules=HEADER)
14591459
for col in test_properties:
14601460
pt.align[col] = "l"
14611461
pt.align['duration'] = "r"
@@ -1495,7 +1495,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','
14951495
if result_summary and not platform_filter:
14961496
# Automation result summary
14971497
test_id_cols = ['automated', 'all', 'percent [%]', 'progress']
1498-
pt = PrettyTable(test_id_cols)
1498+
pt = PrettyTable(test_id_cols, junction_char="|", hrules=HEADER)
14991499
pt.align['automated'] = "r"
15001500
pt.align['all'] = "r"
15011501
pt.align['percent [%]'] = "r"
@@ -1509,7 +1509,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','
15091509

15101510
# Test automation coverage table print
15111511
test_id_cols = ['id', 'automated', 'all', 'percent [%]', 'progress']
1512-
pt = PrettyTable(test_id_cols)
1512+
pt = PrettyTable(test_id_cols, junction_char="|", hrules=HEADER)
15131513
pt.align['id'] = "l"
15141514
pt.align['automated'] = "r"
15151515
pt.align['all'] = "r"

0 commit comments

Comments
 (0)