Skip to content

python scripts : table print with github policy #7720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 7, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tools/build_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,
release_version - get the matrix for this major version number
"""
# Only use it in this function so building works without extra modules
from prettytable import PrettyTable
from prettytable import PrettyTable, HEADER
release_version = _lowercase_release_version(release_version)
version_release_targets = {}
version_release_target_names = {}
Expand All @@ -1184,7 +1184,7 @@ def mcu_toolchain_matrix(verbose_html=False, platform_filter=None,

# All tests status table print
columns = prepend_columns + unique_supported_toolchains
table_printer = PrettyTable(columns)
table_printer = PrettyTable(columns, junction_char="|", hrules=HEADER)
# Align table
for col in columns:
table_printer.align[col] = "c"
Expand Down Expand Up @@ -1272,10 +1272,10 @@ def print_build_memory_usage(report):
Positional arguments:
report - Report generated during build procedure.
"""
from prettytable import PrettyTable
from prettytable import PrettyTable, HEADER
columns_text = ['name', 'target', 'toolchain']
columns_int = ['static_ram', 'total_flash']
table = PrettyTable(columns_text + columns_int)
table = PrettyTable(columns_text + columns_int, junction_char="|", hrules=HEADER)

for col in columns_text:
table.align[col] = 'l'
Expand Down
4 changes: 2 additions & 2 deletions tools/memap.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from argparse import ArgumentParser
from copy import deepcopy
from collections import defaultdict
from prettytable import PrettyTable
from prettytable import PrettyTable, HEADER
from jinja2 import FileSystemLoader, StrictUndefined
from jinja2.environment import Environment

Expand Down Expand Up @@ -669,7 +669,7 @@ def generate_table(self, file_desc):
columns = ['Module']
columns.extend(self.print_sections)

table = PrettyTable(columns)
table = PrettyTable(columns, junction_char="|", hrules=HEADER)
table.align["Module"] = "l"
for col in self.print_sections:
table.align[col] = 'r'
Expand Down
16 changes: 8 additions & 8 deletions tools/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
import ctypes
import functools
from colorama import Fore, Back, Style
from prettytable import PrettyTable
from prettytable import PrettyTable, HEADER
from copy import copy, deepcopy

from time import sleep, time
Expand Down Expand Up @@ -765,7 +765,7 @@ def generate_test_summary_by_target(self, test_summary, shuffle_seed=None):
result_dict[test[TEST_INDEX]][test[TOOLCHAIN_INDEX]] = test[RESULT_INDEX]

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

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

Expand Down Expand Up @@ -1365,7 +1365,7 @@ def print_test_configuration_from_json(json_data, join_delim=", "):

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

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

# All tests status table print
pt = PrettyTable(test_properties)
pt = PrettyTable(test_properties, junction_char="|", hrules=HEADER)
for col in test_properties:
pt.align[col] = "l"
pt.align['duration'] = "r"
Expand Down Expand Up @@ -1494,7 +1494,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','
if result_summary and not platform_filter:
# Automation result summary
test_id_cols = ['automated', 'all', 'percent [%]', 'progress']
pt = PrettyTable(test_id_cols)
pt = PrettyTable(test_id_cols, junction_char="|", hrules=HEADER)
pt.align['automated'] = "r"
pt.align['all'] = "r"
pt.align['percent [%]'] = "r"
Expand All @@ -1508,7 +1508,7 @@ def get_avail_tests_summary_table(cols=None, result_summary=True, join_delim=','

# Test automation coverage table print
test_id_cols = ['id', 'automated', 'all', 'percent [%]', 'progress']
pt = PrettyTable(test_id_cols)
pt = PrettyTable(test_id_cols, junction_char="|", hrules=HEADER)
pt.align['id'] = "l"
pt.align['automated'] = "r"
pt.align['all'] = "r"
Expand Down