summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-12-23 17:45:32 +0900
committerKuninori Morimoto <kuninori.morimoto.gx@renesas.com>2019-12-24 13:26:55 +0900
commitffd8575eb1099413a1bc248007737124f0859314 (patch)
tree9009843152852d4a8dadc4df95158712652a5805 /scripts
parentdc71f3518c95f8d9d306e8a4e53bc9bd2e9928e3 (diff)
chatlog: Auto update for Chat log
This patch adds chatlog.py and auto update Chat log. Each leader need to do is just put chatlog under wiki/Chat_log by this patch. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/chatlog.py60
1 files changed, 60 insertions, 0 deletions
diff --git a/scripts/chatlog.py b/scripts/chatlog.py
new file mode 100755
index 0000000..9a97880
--- /dev/null
+++ b/scripts/chatlog.py
@@ -0,0 +1,60 @@
+#! /usr/bin/env python3
+#===============================
+#
+# chatlog
+#
+# 2019/12/23 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
+#===============================
+import sys
+import os
+import re
+import glob
+
+import base
+#====================================
+#
+# log
+#
+#====================================
+class log(base.base):
+
+ #--------------------
+ # show
+ #--------------------
+ def show(self):
+ print("h1. Chat Log\n")
+
+ current=""
+ year=""
+ dir = "wiki/Chat_log"
+
+ files = glob.glob("{}/{}/*-chatlog".format(self.top(), dir))
+ files.sort(reverse=True)
+
+ for file in files:
+ name = os.path.basename(file)
+ date = re.sub(r'(\d+)-\w*-.*', r'\1', name)
+
+ y = date[0:4]
+ if (year != y):
+ year = y
+ print("\nh2. {}\n".format(year))
+ print("|_. year|_. core|_. io|_. mm|")
+
+ if (date != current):
+ current = date
+
+ print("|{}-{}-{}".format(year, date[4:6], date[6:8]), end="")
+ for grp in ["core", "io", "mm"]:
+ print("|%s" %("\"{}\":../../{}/{}-{}-chatlog".format(grp, dir, date, grp)
+ if "{}/{}/{}-{}-chatlog".format(self.top(), dir, date, grp) in files
+ else ""), end="")
+ print("|")
+
+#====================================
+#
+# As command
+#
+#====================================
+if __name__=='__main__':
+ log().show()