ニジカ AI 共通サービス
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
994 B

  1. from __future__ import annotations
  2. import asyncio
  3. from datetime import date, datetime, time
  4. async def main (
  5. ) -> None:
  6. # キリ番祝ひ
  7. ...
  8. # 投稿報知
  9. ...
  10. # クエリ処理
  11. ...
  12. async def schedule_task (
  13. dt_tuple: tuple[int | None, int | None, int | None, int | None, int | None, int | None],
  14. ) -> None:
  15. ...
  16. def dt_to_tuple (
  17. dt: datetime | date | time,
  18. ) -> tuple[int | None, int | None, int | None, int | None, int | None, int | None]:
  19. year: int | None = None
  20. month: int | None = None
  21. day: int | None = None
  22. hour: int | None = None
  23. minute: int | None = None
  24. second: int | None = None
  25. if not isinstance (dt, time):
  26. year = dt.year
  27. month = dt.month
  28. day = dt.day
  29. if not isinstance (dt, date):
  30. hour = dt.hour
  31. minute = dt.minute
  32. second = dt.second
  33. return (year, month, day, hour, minute, second)
  34. if __name__ == '__main__':
  35. asyncio.run (main ())