|
@@ -1,6 +1,11 @@
|
|
|
import subprocess
|
|
|
import requests
|
|
|
import datetime
|
|
|
+import os
|
|
|
+import glob
|
|
|
+from os import listdir
|
|
|
+from os.path import isfile, join
|
|
|
+
|
|
|
|
|
|
all_ids=['Jared','Hana','huai-sian','jesseng','conradlan','mike','Hong','andy','nina','CJYen','ccc','miacheng913','noodlesloves','yukyo0821','ming']
|
|
|
all_ids=['Jared','Hana','huai-sian','jesseng','conradlan','mike','Hong','andy','nina','CJYen','ccc','miacheng913','noodlesloves','yukyo0821','ming']
|
|
@@ -19,7 +24,7 @@ def notify_group(msg):
|
|
|
#os.system("git log --author Jared --date=short --after=2021-12-20")
|
|
|
|
|
|
#lines=subprocess.run(['git','log','--author','Jared'], capture_output=True)
|
|
|
-allids=""
|
|
|
+""" allids=""
|
|
|
for gid in git_ids:
|
|
|
ot=subprocess.run(['git','log','--author',gid,'--date=short','--after=2021-12-20'], capture_output=True)
|
|
|
print(ot.args)
|
|
@@ -29,11 +34,45 @@ for gid in git_ids:
|
|
|
print(otstr)
|
|
|
if o_len <=0:
|
|
|
allids+= gid+", "
|
|
|
- print('notify')
|
|
|
+ print('notify') """
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+pypath = __file__[0:__file__.replace("\\","/").rfind("/")]
|
|
|
+print(pypath)
|
|
|
+
|
|
|
+os.chdir(pypath + "/..")
|
|
|
+#os.system("cd " + pypath + "/..")
|
|
|
+#os.system("cd ..")
|
|
|
+os.system("git pull")
|
|
|
+
|
|
|
+nologlist = []
|
|
|
+mylist = [f for f in glob.glob(pypath + "/../" + str(datetime.date.today().year) +"/*.md")]
|
|
|
+#print(mylist)
|
|
|
+
|
|
|
+#print(datetime.date.today().strftime("%Y/%m/%d"))
|
|
|
+for file in mylist:
|
|
|
+ f = open(file, 'r' ,encoding='utf8')
|
|
|
+ if not ('## ' + datetime.date.today().strftime("%Y/%m/%d")) in f.read():
|
|
|
+ #print(f.name)
|
|
|
+ #print('true')
|
|
|
+ #else:
|
|
|
+ nologlist.append(f.name[f.name.replace('\\','/').rfind('/')+1:f.name.find('.md')])
|
|
|
+ #print(f.read())
|
|
|
+ f.close()
|
|
|
+
|
|
|
+if len(nologlist) > 0:
|
|
|
+ #print(', '.join(nologlist))
|
|
|
+ print('提醒:' + ', '.join(nologlist) + ' 今天尚未填寫工作日誌喔!')
|
|
|
+ notify_group('提醒:' + ', '.join(nologlist) + ' 今天尚未填寫工作日誌喔!')
|
|
|
|
|
|
-print(allids+" remember to write your work journal" )
|
|
|
-#notify_group(gid+" remember to write your work journal")
|
|
|
+
|
|
|
+#onlyfiles = [f for f in listdir(mypath) if isfile(join(mypath, f))]
|
|
|
+#print(allids+" remember to write your work journal" )
|
|
|
+#notify_group('@yukyo test tag')
|
|
|
+#print('提醒:' + ', '.join(nologlist) + ' 今天尚未填寫工作日誌喔!')
|
|
|
+#notify_group('提醒:' + ', '.join(nologlist) + ' 今天尚未填寫工作日誌喔!')
|
|
|
|
|
|
|
|
|
-wd=datetime.datetime.today().isoweekday()
|
|
|
-print(wd)
|
|
|
+#wd=datetime.datetime.today().isoweekday()
|
|
|
+#print(mylist)
|