diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/base.py | 7 | ||||
-rwxr-xr-x | scripts/myhtml.py | 58 |
2 files changed, 45 insertions, 20 deletions
diff --git a/scripts/base.py b/scripts/base.py index 1a6396e..7430fee 100755 --- a/scripts/base.py +++ b/scripts/base.py @@ -19,6 +19,7 @@ import subprocess class base: __top = os.path.abspath(__file__ + "/../../"); __key = "[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}" + __bsp = ["bsp39x"] #-------------------- # chomp @@ -33,6 +34,12 @@ class base: return base.__top; #-------------------- + # bsp_list() + #-------------------- + def bsp_list(self): + return base.__bsp; + + #-------------------- # is_key() #-------------------- def is_key(self, key): diff --git a/scripts/myhtml.py b/scripts/myhtml.py index e46b65e..2e4636a 100755 --- a/scripts/myhtml.py +++ b/scripts/myhtml.py @@ -332,14 +332,14 @@ class periject_html(base.base): #-------------------- # menu_bsp #-------------------- - def menu_bsp(self): + def menu_bsp(self, bsp): html("a", {"target":"summary", - "href":"./bsp.html"}).print("BSP patch list") + "href":"./{}.html".format(bsp)}).print(bsp) #-------------------- # menu #-------------------- - def menu(self): + def menu(self, argv): self.print_css("html") with html("body"): @@ -360,7 +360,10 @@ class periject_html(base.base): self.menu_team() html("h1").print("BSP") - self.menu_bsp() + with html("ul"): + for bsp in argv: + with html("li"): + self.menu_bsp(bsp) html("div").print("<br><br>update<br>{}".format( datetime.datetime.now().strftime("%Y/%m/%d %H:%M"))) @@ -492,16 +495,26 @@ class periject_html(base.base): #-------------------- # task_commit_bsp #-------------------- - def task_commit_bsp(self, bsp_list): - - cnt = 0 - + def print_commit_bsp(self, bsp_list): with html("ul"): for bsp in bsp_list: - cnt += 1 html("li").print(html("a", {"href":self.commit_url(bsp, "bsp"), "target":"_blank"}).text(self.git_title(bsp))) + return len(bsp_list) + + def task_commit_bsp(self, v): + cnt = 0 + + with html("table"): + for b in self.bsp_list(): + bsp_list = v.get_data(b) + if (not bsp_list): + continue + with html("tr"): + html("th").print(b) + with html("td"): + cnt += self.print_commit_bsp(bsp_list) return cnt #-------------------- @@ -568,19 +581,23 @@ class periject_html(base.base): #-------------------- def task_commit(self, v): - bsp = v.get_data("bsp-commits") + has_bsp = 0 + for b in self.bsp_list(): + if (v.get_data(b)): + has_bsp = 1 + break upstream = v.get_data("upstream") with html("table", {"border":"1"}): with html("tr"): - if (bsp): + if (has_bsp): html("th").print("BSP") if (upstream): html("th").print("upstream") with html("tr"): - if (bsp): + if (has_bsp): with html("td"): - self.task_commit_bsp(bsp) + self.task_commit_bsp(v) if (upstream): with html("td"): self.task_commit_upstream(v) @@ -667,10 +684,11 @@ class periject_html(base.base): cnt_all = 0 cnt_done= 0 tmp = 0 + bsp = argv.pop(0) self.print_css("html") with html("body"): - html("h2").print("BSP patch list") + html("h2").print(bsp) with html("table", {"border":"1"}): with html("tr"): @@ -682,8 +700,8 @@ class periject_html(base.base): v = view.viewer([file]) v.set_data(file) - bsp = v.get_data("bsp-commits") - if (not len(bsp)): + bsp_list = v.get_data(bsp) + if (not bsp_list): continue cnt_all += 1 @@ -695,7 +713,7 @@ class periject_html(base.base): v.get_data("status"))) with html("td"): - tmp = self.task_commit_bsp(bsp) + tmp = self.print_commit_bsp(bsp_list) cnt_bsp += tmp with html("td"): @@ -730,8 +748,8 @@ class periject_html(base.base): # html.py body self.body() elif (cmd == "menu"): - # html.py menu - self.menu() + # html.py menu bsp39x + self.menu(sys.argv) elif (cmd == "summary"): # html.py summary projects/linux/io self.summary(sys.argv) @@ -748,7 +766,7 @@ class periject_html(base.base): # ./script/find.py -t Core | xargs ./script/html.py status Core self.team(sys.argv) elif (cmd == "bsp"): - # ./script/find.py -a | xargs ./script/html.py bsp + # ./script/find.py -is -b bsp39x | xargs ./script/html.py bsp bsp39x self.bsp(sys.argv) elif (cmd == "wiki"): self.wiki(sys.argv) |