From 03f9ca8370c91eb117aacddc407bfd034e2f7a3d Mon Sep 17 00:00:00 2001 From: Yoshihiro Shimoda Date: Thu, 14 Nov 2019 16:15:37 +0900 Subject: scripts: html.py: Change counting of "upstream" and "done" Even if the tasks' status is "New", "Active", "Blocked" or "Paused", the def bsp on htmi.py increases cnt_{up,all} when task_commit_upstream returns non-zero. However, these countings are possible to overlook which bsp patches are still in progress. So, this patch changes the task done counting. Also adds task's status related upported patches counting like below: bsp:184/upstream:160 = 87.0% --> keep as-is. task:57/done:43 = 75.4% (bsp:184/upstream:106 = 57.6%) ~~~~~~~ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ changed add Suggested-by: Kuninori Morimoto Signed-off-by: Yoshihiro Shimoda --- scripts/html.py | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) (limited to 'scripts/html.py') diff --git a/scripts/html.py b/scripts/html.py index dafe5a4..07727d0 100755 --- a/scripts/html.py +++ b/scripts/html.py @@ -463,23 +463,26 @@ class periject_html(base.base): # task_commit_upstream #-------------------- def task_commit_upstream(self, v): + done = 0 + cnt = 0 + status = v.get_data("status") + if (status == "Done" or + status == "Abandoned"): + done = 1 + upstream = v.get_data("upstream") if (not len(upstream)): - status = v.get_data("status") - if (status == "Done" or - status == "Abandoned"): + if (done): html("p").print("ignored") - return 1 - return 0 + cnt = 1 + else: + with html("table"): + for up in upstream: + cnt += self.__task_commit_upstream(v, up, "torvalds") + for up in upstream: + cnt += self.__task_commit_upstream(v, up, "next") - cnt = 0 - with html("table"): - for up in upstream: - cnt += self.__task_commit_upstream(v, up, "torvalds") - for up in upstream: - cnt += self.__task_commit_upstream(v, up, "next") - - return cnt + return (done, cnt) #-------------------- # task_commit @@ -569,6 +572,7 @@ class periject_html(base.base): a = html("a", {"target":"subbody"}) cnt_bsp = 0 cnt_up = 0 + cnt_upd = 0 cnt_all = 0 cnt_done= 0 tmp = 0 @@ -602,13 +606,16 @@ class periject_html(base.base): cnt_bsp += tmp with html("td"): - up = self.task_commit_upstream(v) - if (up): + (done, cnt) = self.task_commit_upstream(v) + if (cnt): cnt_up += tmp + if (done): cnt_done += 1 + cnt_upd += tmp html("p").print("bsp:{}/upstream:{} = {:.1f}%".format(cnt_bsp, cnt_up, cnt_up * 100 /cnt_bsp)) - html("p").print("task:{}/done:{} = {:.1f}%".format(cnt_all, cnt_done, cnt_done * 100 /cnt_all)) + html("p").print("task:{}/done:{} = {:.1f}% (bsp:{}/upstream:{} = {:.1f}%)".format(cnt_all, cnt_done, cnt_done * 100 /cnt_all, + cnt_bsp, cnt_upd, cnt_upd * 100 /cnt_bsp)) #-------------------- # print -- cgit v1.2.3