From e8ae44bebdd072b7b555cca5e0b8389d0eb3dbfd Mon Sep 17 00:00:00 2001 From: Karan Jayachandra Date: Fri, 15 Nov 2024 13:08:05 +0100 Subject: Removed the timer from the backend --- src/match_up/utilities.py | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/match_up/utilities.py') diff --git a/src/match_up/utilities.py b/src/match_up/utilities.py index 8a905ba..8aadfd2 100644 --- a/src/match_up/utilities.py +++ b/src/match_up/utilities.py @@ -27,33 +27,3 @@ def sample_list(indices: list, cost: list[int], count: int = None) -> list: indices, cost = _shuffle_two_lists(indices, cost) indices = _pick_from_list_after_sorting_other(indices, cost)[:count] return indices - - -@dataclass -class Timer: - max_mins: float = DEFAULT_TIMER - ref: float = None - running: bool = False - default: str = ("00", "00") - - def __post_init__(self): - self.max_seconds = self.max_mins * SECS_IN_MIN - - def start(self): - self.ref = time() + self.max_seconds - self.running = True - - def stop(self): - self.ref = None - self.running = False - - def get(self): - if not self.running: - return self.default - total_seconds = self.ref - time() - if total_seconds < 0: - self.stop() - return self.default - mins = f"{int(total_seconds // SECS_IN_MIN):02d}" - secs = f"{int(total_seconds % SECS_IN_MIN):02d}" - return mins, secs -- cgit v1.3.1