import subprocess import requests import datetime 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'] weekday_ids={1:[all_ids],2:[all_ids],3:[all_ids],4:[all_ids],5:[all_ids]} #git_ids=['Jared'] #,'Hana','huai-sian','jesseng','conradlan','mike','Hong','andy','nina','CJYen','ccc','miacheng913','noodlesloves','yukyo0821','ming'] def notify_group(msg): gid='WekCRfnAirSiSxALiD6gcm0B56EejsoK89zFbIaiZQD' headers = {"Authorization": "Bearer " + gid,"Content-Type": "application/x-www-form-urlencoded"} r = requests.post("https://notify-api.line.me/api/notify",headers=headers, params={"message": msg}) #os.system("git log --author Jared --date=short --after=2021-12-20") #lines=subprocess.run(['git','log','--author','Jared'], capture_output=True) 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) otstr=ot.stdout.decode('utf-8').strip() o_len=len(otstr) print(o_len) print(otstr) if o_len <=0: allids+= gid+", " print('notify') print(allids+" remember to write your work journal" ) #notify_group(gid+" remember to write your work journal") wd=datetime.datetime.today().isoweekday() print(wd)