summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-02-26 11:37:24 +0900
committerKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-04-09 14:59:46 +0900
commit2d36f0eefb2f0bb61c2ed2b46d9043ec4564f90a (patch)
treebecf72d3eb964ba8f11f2591b288bdb5db068dd9 /scripts
parent9311577116505151413708316982192fb1b2e875 (diff)
Add BSP patch list on menu
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/html.py81
1 files changed, 73 insertions, 8 deletions
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)
#====================================
#