diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-02-08 12:25:57 +0900 |
---|---|---|
committer | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2021-02-08 12:27:41 +0900 |
commit | edd2189ab2c0c9131b3ebb27d77e2ad9d6e251d6 (patch) | |
tree | 87bf68994d90cd0ce6110765dc0a216a2490c0a0 | |
parent | dbdd23b384c08435ce1f35b0d8da9c21bd1448ef (diff) |
Add Schedule support
This patch adds SoC/BSP schedule support.
PeriPeri member can know the Renesas plan from it.
It is based on timesheet JavaScript which from below
with small customize.
https://github.com/sbstjn/timesheet.js.git
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 9 | ||||
-rw-r--r-- | projects/schedule.py | 30 | ||||
-rwxr-xr-x | scripts/myhtml.py | 4 | ||||
-rw-r--r-- | scripts/timesheet.min.css | 2 | ||||
-rw-r--r-- | scripts/timesheet.min.js | 1 | ||||
-rwxr-xr-x | scripts/timesheet.py | 64 |
7 files changed, 111 insertions, 0 deletions
@@ -1,5 +1,6 @@ .config scripts/__pycache__/ +scripts/schedule.py index.html html wiki/Chat_log.wiki @@ -23,6 +23,7 @@ all: wiki/Chat_log.wiki .git/hooks/pre-commit @make -s LISTS="${PROJECT}" TARGET=summary loop @make -s LISTS="${WIKI}" TARGET=wikis loop @make -s menu + @make -s html/schedule.html @make -s index.html .git/hooks/pre-commit: @@ -32,6 +33,14 @@ wiki/Chat_log.wiki: wiki/Chat_log @echo $@ @./scripts/chatlog.py > $@ +scripts/schedule.py: projects/schedule.py + @echo $@ + @ln -s ../projects/schedule.py $@ + +html/schedule.html: projects/schedule.py scripts/schedule.py + @echo $@ + @./scripts/timesheet.py > $@ + index.html: @ln html/index.html . diff --git a/projects/schedule.py b/projects/schedule.py new file mode 100644 index 0000000..f13c08f --- /dev/null +++ b/projects/schedule.py @@ -0,0 +1,30 @@ +#! /usr/bin/env python3 +#=============================== +# +# schedule +# +# This schedule is based on +# https://github.com/sbstjn/timesheet.js.git +# +# 2021/02/08 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> +#=============================== +class schedule: + list = [ + # SoC + ['07/2020', '04/2023', 'V3U'], + ['07/2020', '12/2021', 'V3H 2.0'], + ['04/2021', '12/2022', 'Gen3e'], + ['06/2021', '07/2023', 'S4'], + ['10/2021', '12/2023', 'V4H'], + ['01/2022', '12/2023', 'M4'], + ['08/2022', '06/2024', 'V4M'], + + # BSP + ['07/2020', '06/2021', 'V3H BSP'], + ['01/2021', '12/2021', 'Gen3e BSP'], + ['01/2021', '12/2022', 'S4 BSP'], + ['02/2021', '02/2022', 'V3U BSP'], + ['04/2021', '12/2022', 'M4 BSP'], + ['07/2021', '12/2023', 'V4H BSP'], + ['02/2022', '12/2023', 'V4M BSP'], + ] diff --git a/scripts/myhtml.py b/scripts/myhtml.py index 2e4636a..a3d7c89 100755 --- a/scripts/myhtml.py +++ b/scripts/myhtml.py @@ -346,6 +346,10 @@ class periject_html(base.base): 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") diff --git a/scripts/timesheet.min.css b/scripts/timesheet.min.css new file mode 100644 index 0000000..999daad --- /dev/null +++ b/scripts/timesheet.min.css @@ -0,0 +1,2 @@ +.timesheet{width:720px;height:500px;margin:0 auto}.timesheet{border-top:1px solid rgba(250,250,250,0.5);background-color:#333;position:relative}.timesheet.color-scheme-default .bubble-default{background-color:RGBA(252, 70, 74, 1)}.timesheet.color-scheme-default .bubble-lorem{background-color:RGBA(154, 202, 39, 1)}.timesheet.color-scheme-default .bubble-ipsum{background-color:RGBA(60, 182, 227, 1)}.timesheet.color-scheme-default .bubble-dolor{background-color:RGBA(244, 207, 48, 1)}.timesheet.color-scheme-default .bubble-sit{background-color:RGBA(169, 105, 202, 1)}.timesheet.color-scheme-alternative .bubble-default{background-color:#f3552e}.timesheet.color-scheme-alternative .bubble-lorem{background-color:#88c33a}.timesheet.color-scheme-alternative .bubble-ipsum{background-color:#436ae0}.timesheet.color-scheme-alternative .bubble-dolor{background-color:#f4d234}.timesheet.color-scheme-alternative .bubble-sit{background-color:#707d86}.timesheet .scale{height:100%;position:absolute;top:0;left:0;float:left}.timesheet .scale section{float:left;width:59px;text-align:center;color:rgba(250,250,250,0.8);font-family:"Signika Negative";font-size:13px;line-height:24px;font-weight:lighter;border-left:1px dashed rgba(250,250,250,0.2);height:100%}.timesheet .data{margin:28px 0 0 0;padding:0;text-align:left;list-style-type:none;color:rgba(250,250,250,0.8);font-family:"Signika Negative";font-size:13px;overflow:hidden}.timesheet .data li{margin:0 0 3px 0;line-height:22px;height:21px;display:block;clear:both;position:relative;white-space:nowrap}.timesheet .data li:hover .bubble{opacity:1}.timesheet .data li .date{color:#b5b5b5;font-size:14px}.timesheet .data li .label{font-weight:lighter;font-size:14px;padding-left:5px;line-height:21px;color:#979796;white-space:nowrap}.timesheet .data li .bubble{width:24px;height:7px;display:block;float:left;position:relative;top:7px;border-radius:4px;margin:0 10px 0 0;opacity:0.7}#timesheet-alternative{background-color:RGBA(247, 247, 247, 1);border-radius:5px}#timesheet-alternative section{color:RGBA(63, 68, 72, 1);border-left:1px dashed RGBA(63, 68, 72, 0.2)}#timesheet-alternative section:first-child{border-left:1px dashed transparent}#timesheet-alternative .date{display:none}#timesheet-alternative .bubble{margin-right:7px}#timesheet-alternative .label{padding-left:0px;color:RGBA(48, 48, 48, 1)} +/*# sourceMappingURL=timesheet.min.css.map */ diff --git a/scripts/timesheet.min.js b/scripts/timesheet.min.js new file mode 100644 index 0000000..2e3963b --- /dev/null +++ b/scripts/timesheet.min.js @@ -0,0 +1 @@ +!function(){"use strict";var Timesheet=function(container,min,max,data){this.data=[],this.year={min:min,max:max},this.parse(data||[]),"undefined"!=typeof document&&(this.container="string"==typeof container?document.querySelector("#"+container):container,this.drawSections(),this.insertData())};Timesheet.prototype.insertData=function(){for(var html=[],widthMonth=this.container.querySelector(".scale section").offsetWidth,n=0,m=this.data.length;m>n;n++){var cur=this.data[n],bubble=this.createBubble(widthMonth,this.year.min,cur.start,cur.end),line=['<span style="margin-left: '+bubble.getStartOffset()+"px; width: "+bubble.getWidth()+'px;" class="bubble bubble-'+(cur.type||"default")+'" data-duration="'+(cur.end?Math.round((cur.end-cur.start)/1e3/60/60/24/39):"")+'"></span>','<span class="label">'+cur.label+"</span>", '<span class="date"> ('+bubble.getDateLabel()+")</span> "].join("");html.push("<li>"+line+"</li>")}this.container.innerHTML+='<ul class="data">'+html.join("")+"</ul>"},Timesheet.prototype.drawSections=function(){for(var html=[],c=this.year.min;c<=this.year.max;c++)html.push("<section>"+c+"</section>");this.container.className="timesheet color-scheme-default",this.container.innerHTML='<div class="scale">'+html.join("")+"</div>"},Timesheet.prototype.parseDate=function(date){return-1===date.indexOf("/")?(date=new Date(parseInt(date,10),0,1),date.hasMonth=!1):(date=date.split("/"),date=new Date(parseInt(date[1],10),parseInt(date[0],10)-1,1),date.hasMonth=!0),date},Timesheet.prototype.parse=function(data){for(var n=0,m=data.length;m>n;n++){var beg=this.parseDate(data[n][0]),end=4===data[n].length?this.parseDate(data[n][1]):null,lbl=4===data[n].length?data[n][2]:data[n][1],cat=4===data[n].length?data[n][3]:3===data[n].length?data[n][2]:"default";beg.getFullYear()<this.year.min&&(this.year.min=beg.getFullYear()),end&&end.getFullYear()>this.year.max?this.year.max=end.getFullYear():beg.getFullYear()>this.year.max&&(this.year.max=beg.getFullYear()),this.data.push({start:beg,end:end,label:lbl,type:cat})}},Timesheet.prototype.createBubble=function(wMonth,min,start,end){return new Bubble(wMonth,min,start,end)};var Bubble=function(wMonth,min,start,end){this.min=min,this.start=start,this.end=end,this.widthMonth=wMonth};Bubble.prototype.formatMonth=function(num){return num=parseInt(num,10),num>=10?num:"0"+num},Bubble.prototype.getStartOffset=function(){return this.widthMonth/12*(12*(this.start.getFullYear()-this.min)+this.start.getMonth())},Bubble.prototype.getFullYears=function(){return(this.end&&this.end.getFullYear()||this.start.getFullYear())-this.start.getFullYear()},Bubble.prototype.getMonths=function(){var fullYears=this.getFullYears(),months=0;return this.end?this.end.hasMonth?(months+=this.end.getMonth()+1,months+=12-(this.start.hasMonth?this.start.getMonth():0),months+=12*(fullYears-1)):(months+=12-(this.start.hasMonth?this.start.getMonth():0),months+=12*(fullYears-1>0?fullYears-1:0)):months+=this.start.hasMonth?1:12,months},Bubble.prototype.getWidth=function(){return this.widthMonth/12*this.getMonths()},Bubble.prototype.getDateLabel=function(){return[(this.start.hasMonth?this.formatMonth(this.start.getMonth()+1)+"/":"")+this.start.getFullYear(),this.end?"-"+((this.end.hasMonth?this.formatMonth(this.end.getMonth()+1)+"/":"")+this.end.getFullYear()):""].join("")},window.Timesheet=Timesheet}(); diff --git a/scripts/timesheet.py b/scripts/timesheet.py new file mode 100755 index 0000000..a508fec --- /dev/null +++ b/scripts/timesheet.py @@ -0,0 +1,64 @@ +#! /usr/bin/env python3 +#=============================== +# +# timesheet +# +# This schedule is based on +# https://github.com/sbstjn/timesheet.js.git +# +# 2021/02/08 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> +#=============================== +import schedule +import datetime + +class timesheet(schedule.schedule): + def print(self): + color = ['lorem', 'ipsum', 'dolor', 'default'] + txt_b = """ +<html> + <link rel="stylesheet" type="text/css" href="../scripts/timesheet.min.css"> + <script type="text/javascript" src="../scripts/timesheet.min.js"></script> + <h1>PeriPeri Schedule</h1> + <div id="timesheet"></div> + <script> +""" + txt_e = """ + </script> +</html> +""" + txt = "new Timesheet('timesheet', " + date_s = datetime.datetime(9999, 12, 31, 10, 0, 0) + date_e = datetime.datetime(1000, 1, 1, 10, 0, 0) + + # check earliest/latest date + for lst in self.list: + ds = datetime.datetime.strptime(lst[0], "%m/%Y") + de = datetime.datetime.strptime(lst[1], "%m/%Y") + if ds < date_s: + date_s = ds + if (de > date_e): + date_e = de + + txt += "{}, {}, [".format(date_s.strftime("%Y"), + date_e.strftime("%Y")) + + c = 0 + for lst in self.list: + txt += "['{}', '{}', '{}', '{}'],".\ + format(lst[0], lst[1], lst[2], color[c]) + c += 1 + if (c >= len(color)): + c = 0 + txt += "]);" + + print(txt_b) + print(txt) + print(txt_e) + +#==================================== +# +# As command +# +#==================================== +if __name__=='__main__': + timesheet().print() |