blob: 5a8a55676d8fb6ec13538d99753ed7a12da65829 (
plain)
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
|
import sqlite3
from db import get_connection, init_db
from screens import (
log_weight,
log_workout,
manage_workout_exercises,
manage_workout_templates,
view_weight_logs,
view_workout_sessions,
)
def main_menu(conn: sqlite3.Connection) -> None:
import ui
while True:
ui.clear_screen()
print("=== EgoMetrics ===\n")
print("1. Log Workout")
print("2. View Workout Sessions")
print("3. Manage Workout Exercises")
print("4. Manage Workout Templates")
print("5. Log Weight")
print("6. View Weight Logs")
print("7. Quit")
choice = input("\n> ").strip()
if choice == "1":
log_workout(conn)
elif choice == "2":
view_workout_sessions(conn)
elif choice == "3":
manage_workout_exercises(conn)
elif choice == "4":
manage_workout_templates(conn)
elif choice == "5":
log_weight(conn)
elif choice == "6":
view_weight_logs(conn)
elif choice == "7":
break
def main() -> None:
init_db()
conn = get_connection()
try:
main_menu(conn)
except KeyboardInterrupt:
print("\nGoodbye!")
finally:
conn.close()
if __name__ == "__main__":
main()
|