From 2d36f0eefb2f0bb61c2ed2b46d9043ec4564f90a Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Tue, 26 Feb 2019 11:37:24 +0900 Subject: Add BSP patch list on menu Signed-off-by: Kuninori Morimoto --- scripts/html.py | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 73 insertions(+), 8 deletions(-) (limited to 'scripts') diff --git a/scripts/html.py b/scripts/html.py index 80842cc..094a59b 100755 --- a/scripts/html.py +++ b/scripts/html.py @@ -249,6 +249,13 @@ class periject_html(base.base): html("li").print(html("a", {"target":"summary", "href":"./{}.html".format(status)}).text(status)) + #-------------------- + # menu_bsp + #-------------------- + def menu_bsp(self): + html("a", {"target":"summary", + "href":"./bsp.html"}).print("BSP patch list") + #-------------------- # menu #-------------------- @@ -265,6 +272,9 @@ class periject_html(base.base): html("h1").print("Status") self.menu_status() + html("h1").print("BSP") + self.menu_bsp() + #-------------------- # body #-------------------- @@ -351,36 +361,50 @@ class periject_html(base.base): #-------------------- # task_commit_bsp #-------------------- - def task_commit_bsp(self, v): + def task_commit_bsp(self, bsp_list): + + cnt = 0 with html("ul"): - for bsp in v.get_data("bsp-commits"): - html("li").print(html("a", {"href":self.bsp_url(bsp)}).text(self.git_title(bsp))) + for bsp in bsp_list: + cnt += 1 + html("li").print(html("a", {"href":self.bsp_url(bsp), + "target":"subbody"}).text(self.git_title(bsp))) + + return cnt #-------------------- # __task_commit_upstream #-------------------- def __task_commit_upstream(self, v, upstream, item): if (not item in upstream): - return + return 0 commit = upstream[item] with html("tr"): html("td").print(item) - html("td").print(html("a", {"href":self.upstream_url(commit)}).text(self.git_title(commit))) + html("td").print(html("a", {"href":self.upstream_url(commit), + "target":"subbody"}).text(self.git_title(commit))) + + return 1 #-------------------- # task_commit_upstream #-------------------- def task_commit_upstream(self, v): upstream = v.get_data("upstream") + if (not len(upstream)): + return 0 + cnt = 0 with html("table"): for up in upstream: - self.__task_commit_upstream(v, up, "torvalds") + cnt += self.__task_commit_upstream(v, up, "torvalds") for up in upstream: - self.__task_commit_upstream(v, up, "next") + cnt += self.__task_commit_upstream(v, up, "next") + + return cnt #-------------------- # task_commit @@ -397,7 +421,7 @@ class periject_html(base.base): html("th").print("upstream") with html("tr"): with html("td"): - self.task_commit_bsp(v) + self.task_commit_bsp(bsp) with html("td"): self.task_commit_upstream(v) @@ -436,6 +460,44 @@ class periject_html(base.base): with html("body"): self.__summary(mem, "{}/html".format(self.top()), argv) + #-------------------- + # bsp + #-------------------- + def bsp(self, argv): + + a = html("a", {"target":"subbody"}) + cnt_bsp = 0 + cnt_up = 0 + with html("body"): + html("h1").print("BSP patch list") + + with html("table", {"border":"1"}): + with html("tr"): + html("th").print("file") + html("th").print("BSP") + html("th").print("upstream") + + for file in argv: + v = view.viewer([file]) + v.set_data(file) + + bsp = v.get_data("bsp-commits") + if (not len(bsp)): + continue + + with html("tr"): + a.option({"href": + os.path.relpath(file.replace("yaml", "html").replace("projects", "html"), "{}/html".format(self.top()))}) + html("td").print(a.text(os.path.basename(file).replace(".yaml", ""))) + + with html("td"): + cnt_bsp += self.task_commit_bsp(bsp) + + with html("td"): + cnt_up += self.task_commit_upstream(v) + + html("p").print("bsp:{}/upstream:{} = {:.1f}% done".format(cnt_bsp, cnt_up, cnt_up * 100 /cnt_bsp)) + #-------------------- # print #-------------------- @@ -470,6 +532,9 @@ class periject_html(base.base): elif (cmd == "status"): # ./script/find.py -s Active | xargs ./script/html.py status Active self.member(sys.argv) + elif (cmd == "bsp"): + # ./script/html.py bsp xxx.yaml xxx.yaml ... + self.bsp(sys.argv) #==================================== # -- cgit v1.2.3