diff options
-rw-r--r-- | Makefile | 9 | ||||
-rwxr-xr-x | scripts/html.py | 81 |
2 files changed, 80 insertions, 10 deletions
@@ -1,11 +1,12 @@ CMD = ./scripts/html.py +ALLYAML = $(shell ./scripts/find.py -a) FOLDERS = $(subst ./,,$(shell cd ./projects; find -type d)) DST = $(subst yaml,html,$(subst projects,html,${SRC})) MEMBER = BSP Geert Jacopo Kaneko Kieran Laurent Magnus Marek Morimoto Niklas Shimoda Simon Ulrich Wolfram STATUS = New Active Blocked Paused Done Abandoned SPF = menu subindex body -all: summary spf files index.html members statuss +all: summary spf files index.html members statuss html/bsp.html summary: @for folder in ${FOLDERS}; do\ @@ -31,7 +32,7 @@ index.html: ${CMD} @${CMD} index > $@ files: - @for file in $(shell ./scripts/find.py -a); do\ + @for file in ${ALLYAML}; do\ make -s SRC=$${file} file;\ done; @@ -58,6 +59,10 @@ ${DST}: ${SRC} ${CMD} @echo "${DST}" ${CMD} ${TGT} ${SRC} > $@ +html/bsp.html: ${ALLYAML} ${CMD} + @echo $@ + @${CMD} bsp ${ALLYAML} > $@ + clean: @rm -fr html @rm -fr *.html diff --git a/scripts/html.py b/scripts/html.py index 80842cc..094a59b 100755 --- a/scripts/html.py +++ b/scripts/html.py @@ -250,6 +250,13 @@ class periject_html(base.base): "href":"./{}.html".format(status)}).text(status)) #-------------------- + # menu_bsp + #-------------------- + def menu_bsp(self): + html("a", {"target":"summary", + "href":"./bsp.html"}).print("BSP patch list") + + #-------------------- # menu #-------------------- def menu(self): @@ -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) @@ -437,6 +461,44 @@ class periject_html(base.base): 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 #-------------------- def print(self, argv): @@ -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) #==================================== # |