Skip to content
This repository was archived by the owner on May 23, 2023. It is now read-only.

Commit a42c73d

Browse files
committed
python scripts : table print with github policy
1 parent 1e676f6 commit a42c73d

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

tools/build_api.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,7 +1162,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
11621162
release_version - get the matrix for this major version number
11631163
"""
11641164
# Only use it in this function so building works without extra modules
1165-
from prettytable import PrettyTable
1165+
from prettytable import PrettyTable, HEADER
11661166
release_version = _lowercase_release_version(release_version)
11671167
version_release_targets = {}
11681168
version_release_target_names = {}
@@ -1184,7 +1184,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
11841184

11851185
# All tests status table print
11861186
columns = prepend_columns + unique_supported_toolchains
1187-
table_printer = PrettyTable(columns)
1187+
table_printer = PrettyTable(columns, junction_char="|", hrules=HEADER)
11881188
# Align table
11891189
for col in columns:
11901190
table_printer.align[col] = "c"
@@ -1272,10 +1272,10 @@ def print_build_memory_usage(report):
12721272
Positional arguments:
12731273
report - Report generated during build procedure.
12741274
"""
1275-
from prettytable import PrettyTable
1275+
from prettytable import PrettyTable, HEADER
12761276
columns_text = ['name', 'target', 'toolchain']
12771277
columns_int = ['static_ram', 'total_flash']
1278-
table = PrettyTable(columns_text + columns_int)
1278+
table = PrettyTable(columns_text + columns_int, junction_char="|", hrules=HEADER)
12791279

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

tools/memap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
from argparse import ArgumentParser
1515
from copy import deepcopy
1616
from collections import defaultdict
17-
from prettytable import PrettyTable
17+
from prettytable import PrettyTable, HEADER
1818
from jinja2 import FileSystemLoader, StrictUndefined
1919
from jinja2.environment import Environment
2020

@@ -669,7 +669,7 @@ def generate_table(self, file_desc):
669669
columns = ['Module']
670670
columns.extend(self.print_sections)
671671

672-
table = PrettyTable(columns)
672+
table = PrettyTable(columns, junction_char="|", hrules=HEADER)
673673
table.align["Module"] = "l"
674674
for col in self.print_sections:
675675
table.align[col] = 'r'

tools/test_api.py

Lines changed: 8 additions & 8 deletions
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
@@ -765,7 +765,7 @@ def generate_test_summary_by_target(self, test_summary, shuffle_seed=None):
765765
result_dict[test[TEST_INDEX]][test[TOOLCHAIN_INDEX]] = test[RESULT_INDEX]
766766

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

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

@@ -1365,7 +1365,7 @@ def print_test_configuration_from_json(json_data, join_delim=", "):
13651365

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

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

14561456
# All tests status table print
1457-
pt = PrettyTable(test_properties)
1457+
pt = PrettyTable(test_properties, junction_char="|", hrules=HEADER)
14581458
for col in test_properties:
14591459
pt.align[col] = "l"
14601460
pt.align['duration'] = "r"
@@ -1494,7 +1494,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','
14941494
if result_summary and not platform_filter:
14951495
# Automation result summary
14961496
test_id_cols = ['automated', 'all', 'percent [%]', 'progress']
1497-
pt = PrettyTable(test_id_cols)
1497+
pt = PrettyTable(test_id_cols, junction_char="|", hrules=HEADER)
14981498
pt.align['automated'] = "r"
14991499
pt.align['all'] = "r"
15001500
pt.align['percent [%]'] = "r"
@@ -1508,7 +1508,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','
15081508

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

0 commit comments

Comments
 (0)