#! /usr/bin/env python3 #=============================== # # html_bsp # # 2021/02/09 Kuninori Morimoto #=============================== import sys import os import view import html_base from html_base import html #==================================== # # periject_html # #==================================== class periject_html(html_base.myhtml): #-------------------- # print #-------------------- def print(self, argv): # remove this script argv.pop(0) a = html("a", {"target":"subbody"}) cnt_bsp = 0 cnt_up = 0 cnt_upd = 0 cnt_all = 0 cnt_done= 0 tmp = 0 bsp = argv.pop(0) self.print_css("html") with html("body"): html("h2").print(bsp) 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_list = v.get_data(bsp) if (not bsp_list): continue cnt_all += 1 with html("tr"): a.option({"href": self.relpath_y2h(file, "{}/html".format(self.top()))}) html("th").print("{}
({})".format( a.text(os.path.basename(file).replace(".yaml", "")), v.get_data("status"))) with html("td"): tmp = self.print_commit_bsp(bsp_list) cnt_bsp += tmp with html("td"): (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}% (bsp:{}/upstream:{} = {:.1f}%)".format(cnt_all, cnt_done, cnt_done * 100 /cnt_all, cnt_bsp, cnt_upd, cnt_upd * 100 /cnt_bsp)) #==================================== # # As command # #==================================== if __name__=='__main__': # ./script/find.py -is -b bsp39x | xargs ./script/html_bsp.py bsp39x periject_html().print(sys.argv)