summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile5
-rwxr-xr-xscripts/html_menu.py132
2 files changed, 135 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 3e41a9c..917a707 100644
--- a/Makefile
+++ b/Makefile
@@ -67,13 +67,14 @@ wikis:
make CMD=wiki FILES="${PARAM}" HTML=$(addprefix html/,$(subst .wiki,.html,${PARAM})) myhtml
noparam:
make CMD=${PARAM} HTML=html/${PARAM}.html myhtml
+menu:
+ make CMD=menu OPTION="${BSP}" HTML=html/menu.html myhtml
+
basic:
make HTML_OPTION1="${HTML_OPTION1}" HTML_OPTION2="${HTML_OPTION2}" FILE=${FILE} ${FILE}
finds:
make HTML_OPTION1="${EXP1} ${PARAM}" HTML_OPTION2="$(shell ${FIND} ${EXP2} ${PARAM})" FILE=html/${PARAM}.html basic
-menu:
- make HTML_OPTION1="menu ${BSP}" HTML_OPTION2="" FILE=html/menu.html basic
clean:
@rm -fr html
@rm -fr *.html
diff --git a/scripts/html_menu.py b/scripts/html_menu.py
new file mode 100755
index 0000000..1199529
--- /dev/null
+++ b/scripts/html_menu.py
@@ -0,0 +1,132 @@
+#! /usr/bin/env python3
+#===============================
+#
+# html_menu
+#
+# 2021/02/09 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+#===============================
+import sys
+import os
+import datetime
+
+import view
+import html_base
+from html_base import html
+#====================================
+#
+# periject_html
+#
+#====================================
+class periject_html(html_base.myhtml):
+
+ #--------------------
+ # menu_wiki
+ #--------------------
+ def menu_wiki(self):
+ html("a", {"target":"_blank",
+ "href":"./wiki/top.html"}).print("Peri Peri Wiki")
+
+ #--------------------
+ # menu_folder
+ #--------------------
+ def menu_folder(self, current):
+ folders = self.runl("cd {}; ls -F | grep /".format(current))
+ path = current.replace("./projects", ".")
+ link = html("a", {"target":"summary",
+ "href":"{}/summary.html".format(path)})
+
+ html("li").print(link.text(os.path.basename(current)))
+
+ if (not folders):
+ return
+
+ with html("ul"):
+ for folder in folders:
+ dir = os.path.basename(folder)
+ self.menu_folder("{}/{}".format(current, folder[:-1]))
+
+ #--------------------
+ # menu_assignee
+ #--------------------
+ def menu_assignee(self):
+ # from project.schema.yaml
+ with html("ul"):
+ for assignee in ['BSP', 'Geert', 'Jacopo', 'Kaneko', 'Kieran', 'Laurent', 'Magnus', 'Marek',
+ 'Morimoto', 'Niklas', 'Shimoda', 'Simon', 'Ulrich', 'Wolfram', "NoAssignee"]:
+ html("li").print(html("a", {"target":"summary",
+ "href":"./{}.html".format(assignee)}).text(assignee))
+
+ #--------------------
+ # menu_status
+ #--------------------
+ def menu_status(self):
+ # from project.schema.yaml
+ with html("ul"):
+ for status in ['New', 'Active', 'Blocked', 'Paused', 'Done', 'Abandoned']:
+ html("li").print(html("a", {"target":"summary",
+ "href":"./{}.html".format(status)}).text(status))
+
+ #--------------------
+ # menu_team
+ #--------------------
+ def menu_team(self):
+ # from project.schema.yaml
+ with html("ul"):
+ for status in ['Core', 'IO', 'MM']:
+ html("li").print(html("a", {"target":"summary",
+ "href":"./{}.html".format(status)}).text(status))
+
+ #--------------------
+ # menu_bsp
+ #--------------------
+ def menu_bsp(self, bsp):
+ html("a", {"target":"summary",
+ "href":"./{}.html".format(bsp)}).print(bsp)
+
+ #--------------------
+ # print
+ #--------------------
+ def print(self, argv):
+
+ # remove this script
+ argv.pop(0)
+
+ self.print_css("html")
+ with html("body"):
+ html("h1").print("Wiki")
+ self.menu_wiki()
+
+ html("h1").print("Schedule")
+ html("a", {"target":"summary",
+ "href":"./schedule.html"}).print("schedule")
+
+ html("h1").print("Folder")
+ with html("ul"):
+ self.menu_folder("./projects")
+
+ html("h1").print("Assignee")
+ self.menu_assignee()
+
+ html("h1").print("Status")
+ self.menu_status()
+
+ html("h1").print("Team")
+ self.menu_team()
+
+ html("h1").print("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")))
+
+#====================================
+#
+# As command
+#
+#====================================
+if __name__=='__main__':
+ # html_menu.py bsp39x
+ periject_html().print(sys.argv)