log_scan.py 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import subprocess
  2. import requests
  3. import datetime
  4. all_ids=['Jared','Hana','huai-sian','jesseng','conradlan','mike','Hong','andy','nina','CJYen','ccc','miacheng913','noodlesloves','yukyo0821','ming']
  5. all_ids=['Jared','Hana','huai-sian','jesseng','conradlan','mike','Hong','andy','nina','CJYen','ccc','miacheng913','noodlesloves','yukyo0821','ming']
  6. weekday_ids={1:[all_ids],2:[all_ids],3:[all_ids],4:[all_ids],5:[all_ids]}
  7. #git_ids=['Jared']
  8. #,'Hana','huai-sian','jesseng','conradlan','mike','Hong','andy','nina','CJYen','ccc','miacheng913','noodlesloves','yukyo0821','ming']
  9. def notify_group(msg):
  10. gid='WekCRfnAirSiSxALiD6gcm0B56EejsoK89zFbIaiZQD'
  11. headers = {"Authorization": "Bearer " + gid,"Content-Type": "application/x-www-form-urlencoded"}
  12. r = requests.post("https://notify-api.line.me/api/notify",headers=headers, params={"message": msg})
  13. #os.system("git log --author Jared --date=short --after=2021-12-20")
  14. #lines=subprocess.run(['git','log','--author','Jared'], capture_output=True)
  15. allids=""
  16. for gid in git_ids:
  17. ot=subprocess.run(['git','log','--author',gid,'--date=short','--after=2021-12-20'], capture_output=True)
  18. print(ot.args)
  19. otstr=ot.stdout.decode('utf-8').strip()
  20. o_len=len(otstr)
  21. print(o_len)
  22. print(otstr)
  23. if o_len <=0:
  24. allids+= gid+", "
  25. print('notify')
  26. print(allids+" remember to write your work journal" )
  27. #notify_group(gid+" remember to write your work journal")
  28. wd=datetime.datetime.today().isoweekday()
  29. print(wd)