-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbase.py
72 lines (55 loc) · 1.41 KB
/
base.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
class BaseTimer:
"""
The base class guiding the implementation of timers.
All methods must be implemented.
"""
def __init__(self, **kwargs):
pass
def start(self):
"""
Start the timer initially or resume after pause
Raises:
NotImplementedError
"""
raise NotImplementedError()
def pause(self):
"""
Pause the timer
Raises:
NotImplementedError
"""
raise NotImplementedError()
def toggle_pause(self):
"""
Toggle pause state
Raises:
NotImplementedError
"""
raise NotImplementedError()
def stop(self) -> float:
"""
Stop the timer. Should only be called once when stopping the timer.
Returns:
The time the timer was stopped
Raises:
NotImplementedError
"""
raise NotImplementedError()
def get_time(self) -> float:
"""
Get the current time in seconds
Returns:
The current time in seconds
Raises:
NotImplementedError
"""
raise NotImplementedError()
def set_time(self, value: float):
"""
Set the current time in seconds.
Args:
value (float): The new time
Raises:
NotImplementedError
"""
raise NotImplementedError()