summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-02-26 17:13:11 +0900
committerKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-04-09 14:59:46 +0900
commit0562110e003c7db39382d790866bb5565604c8ea (patch)
treec2011e16a8cb1efef3507e28a1528ac282f03490
parent2d36f0eefb2f0bb61c2ed2b46d9043ec4564f90a (diff)
html: status based summary
status based summary is easy to see Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-rwxr-xr-xscripts/html.py77
1 files changed, 63 insertions, 14 deletions
diff --git a/scripts/html.py b/scripts/html.py
index 094a59b..cdc77c9 100755
--- a/scripts/html.py
+++ b/scripts/html.py
@@ -161,23 +161,22 @@ class periject_html(base.base):
#--------------------
# summary
#--------------------
- def __summary(self, title, dir, files):
- # -------
- # summary
- # -------
- #
- # -------
- html("h2").print(title)
+ def ___summary(self, status, dir, files):
+
+ if (not len(files)):
+ return
+
+ html("h3").print(html("a", {"target":"summary",
+ "href":self.relpath("html/{}.html".format(status), dir)}).text(status))
+
with html("table", {"border":"1"}):
with html("tr"):
html("th").print("file")
- html("th").print("status")
html("th").print("assignee")
html("th").print("title")
for file in files:
v = view.viewer([file])
v.set_data(file)
- f = os.path.basename(file)
subbody = html("a", {"target":"subbody"})
summary = html("a", {"target":"summary"})
@@ -185,10 +184,6 @@ class periject_html(base.base):
subbody.option({"href":self.relpath_y2h(file, dir)})
html("td").print(subbody.text(os.path.basename(file).replace(".yaml", "")))
- status = v.get_data("status")
- summary.option({"href":self.relpath("html/{}.html".format(status), dir)})
- html("td").print(summary.text(status))
-
assignee = v.get_data("assignee")
summary.option({"href":self.relpath("html/{}.html".format(assignee), dir)})
html("td").print(summary.text(assignee))
@@ -198,6 +193,50 @@ class periject_html(base.base):
#--------------------
# summary
#--------------------
+ def __summary(self, title, dir, files):
+ # -------
+ # summary
+ # -------
+ #
+ # -------
+ if (title):
+ html("h2").print(title)
+
+ new = []
+ active = []
+ blocked = []
+ paused = []
+ done = []
+ abandoned = []
+
+ for file in files:
+ v = view.viewer([file])
+ v.set_data(file)
+
+ status = v.get_data("status")
+ if (status == "New"):
+ new.append(file)
+ elif (status == "Active"):
+ active.append(file)
+ elif (status == "Blocked"):
+ blocked.append(file)
+ elif (status == "Paused"):
+ paused.append(file)
+ elif (status == "Done"):
+ done.append(file)
+ else:
+ abandoned.append(file)
+
+ self.___summary("New", dir, new)
+ self.___summary("Active", dir, active)
+ self.___summary("Blocked", dir, blocked)
+ self.___summary("Paused", dir, paused)
+ self.___summary("Done", dir, done)
+ self.___summary("Abandoned", dir, abandoned)
+
+ #--------------------
+ # summary
+ #--------------------
def summary(self, argv):
dir = os.path.normpath(argv[0])
@@ -461,6 +500,16 @@ class periject_html(base.base):
self.__summary(mem, "{}/html".format(self.top()), argv)
#--------------------
+ # status
+ #--------------------
+ def status(self, argv):
+
+ argv.pop(0)
+
+ with html("body"):
+ self.__summary(None, "{}/html".format(self.top()), argv)
+
+ #--------------------
# bsp
#--------------------
def bsp(self, argv):
@@ -531,7 +580,7 @@ class periject_html(base.base):
self.member(sys.argv)
elif (cmd == "status"):
# ./script/find.py -s Active | xargs ./script/html.py status Active
- self.member(sys.argv)
+ self.status(sys.argv)
elif (cmd == "bsp"):
# ./script/html.py bsp xxx.yaml xxx.yaml ...
self.bsp(sys.argv)