-
Notifications
You must be signed in to change notification settings - Fork 3
/
workouts.py
39 lines (29 loc) · 1.03 KB
/
workouts.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
import pyfiglet
import caffeine
from .progress import say, display, timed_rest, untimed_rest
from .trainers import Rishi
""" A 'workout' defines a full exercise regime.
It consists of several 'programs', each containing a set of excercises executed in a `routine`.
"""
class workout():
def __init__(self, name, sections, trainer=Rishi):
self.name = name
self.sections = sections
self.trainer = trainer
def welcome(self):
ascii_banner = pyfiglet.figlet_format("Script My Workout")
print(ascii_banner)
def print_info(self):
display(f'\nrunning workout: "{self.name}" with sections:')
for i, section in enumerate(self.sections):
display(f' section {i}: {section.name}')
def run(self):
caffeine.on(display=True)
self.welcome()
# self.trainer.introduce()
self.print_info()
for section in self.sections:
untimed_rest()
# self.trainer.say_phrase()
section.run()
caffeine.off()