From edd2189ab2c0c9131b3ebb27d77e2ad9d6e251d6 Mon Sep 17 00:00:00 2001 From: Kuninori Morimoto Date: Mon, 8 Feb 2021 12:25:57 +0900 Subject: 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 --- scripts/timesheet.py | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100755 scripts/timesheet.py (limited to 'scripts/timesheet.py') 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 +#=============================== +import schedule +import datetime + +class timesheet(schedule.schedule): + def print(self): + color = ['lorem', 'ipsum', 'dolor', 'default'] + txt_b = """ + + + +

PeriPeri Schedule

+
+ + +""" + 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() -- cgit v1.2.3