(count)
| 109 | |
| 110 | |
| 111 | def count_down(count): |
| 112 | global timer_mec, remaining_time |
| 113 | remaining_time = count |
| 114 | minutes = count // 60 |
| 115 | seconds = count % 60 |
| 116 | if seconds < 10: |
| 117 | seconds = f"0{seconds}" |
| 118 | canvas.itemconfig(timer_text, text=f"{minutes}:{seconds}") |
| 119 | |
| 120 | if total_time > 0: |
| 121 | progress = (total_time - count) / total_time |
| 122 | canvas.itemconfig(progress_arc, extent=progress * 360) |
| 123 | |
| 124 | if count > 0 and not is_paused: |
| 125 | timer_mec = window.after(1000, count_down, count - 1) |
| 126 | elif count == 0: |
| 127 | if ROUND % 2 == 1: |
| 128 | show_notification("Work session complete! Time for a break.") |
| 129 | else: |
| 130 | show_notification("Break over! Back to work.") |
| 131 | if ROUND % 2 == 0: |
| 132 | tick_label.config(text=tick_label.cget("text") + "#") |
| 133 | ROUND += 1 |
| 134 | start_timer() |
| 135 | |
| 136 | |
| 137 | def pause_timer(): |
no test coverage detected