diff --git a/gh_review_project/cr_deadline.py b/gh_review_project/cr_deadline.py old mode 100644 new mode 100755 index a8f419d2..8f84297e --- a/gh_review_project/cr_deadline.py +++ b/gh_review_project/cr_deadline.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # (C) Crown copyright Met Office. All rights reserved. # The file LICENCE, distributed with this code, contains details of the terms diff --git a/gh_review_project/finish_milestone.py b/gh_review_project/finish_milestone.py old mode 100644 new mode 100755 index 0ffedaf8..ba2281b0 --- a/gh_review_project/finish_milestone.py +++ b/gh_review_project/finish_milestone.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # (C) Crown copyright Met Office. All rights reserved. # The file LICENCE, distributed with this code, contains details of the terms diff --git a/gh_review_project/set_milestone.py b/gh_review_project/set_milestone.py old mode 100644 new mode 100755 index 1995326a..01a2c710 --- a/gh_review_project/set_milestone.py +++ b/gh_review_project/set_milestone.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # (C) Crown copyright Met Office. All rights reserved. # The file LICENCE, distributed with this code, contains details of the terms diff --git a/gh_review_project/workload.py b/gh_review_project/workload.py old mode 100644 new mode 100755 index 63748adf..0eb4df9c --- a/gh_review_project/workload.py +++ b/gh_review_project/workload.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # ----------------------------------------------------------------------------- # (C) Crown copyright Met Office. All rights reserved. # The file LICENCE, distributed with this code, contains details of the terms @@ -144,21 +145,31 @@ def build_table(data: ProjectData, reviewer_list: list, repos: list) -> PrettyTa return table -def print_table(title: str, table: PrettyTable, sortTotal: bool) -> None: +def print_table( + title: str, table: PrettyTable, sortTotal: bool, html_output: str = "" +) -> None: """ Print a pretty table and its title. title: str Title of table to be printed first table: PrettyTable table to be printed """ - print(title) - # table.set_style(TableStyle.MARKDOWN) #requires newer version + table.align["Reviewer"] = "l" if sortTotal: table.sortby = "Total" - print(table) + if not html_output: + print(title) + print(table) + return + + table.format = True + html_table = table.get_html_string() + with open(html_output, "a") as f: + f.write(f"