helpers.py 450 B

12345678910111213141516171819
  1. from constants import *
  2. def breaks_and_colors(reps: int):
  3. if reps % (LONG_AFTER * 2) == 0:
  4. return "Break", RED, LONG_BREAK_MIN
  5. elif reps % 2 == 0:
  6. return "Short break", PINK, SHORT_BREAK_MIN
  7. else:
  8. return "Work", GREEN, WORK_MIN
  9. def sec2text(count: int) -> str:
  10. min = count // 60
  11. sec = count % 60
  12. if sec < 10:
  13. sec = f"0{sec}"
  14. if min < 10:
  15. min = f"0{min}"
  16. return f"{min}:{sec}"