-
Notifications
You must be signed in to change notification settings - Fork 359
/
app.py
49 lines (39 loc) · 1.14 KB
/
app.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
from src.database import add_reminder, list_reminders
from src.deadlined_reminders import DateReminder, DeadlinedReminder
from src.external_reminders import EveningReminder
from src.reminder import PoliteReminder
DeadlinedReminder.register(PoliteReminder)
def handle_input():
choice = input("Choice: ")
if choice == "3":
return False
if(choice == "1"):
list_reminders()
elif(choice == "2"):
print()
reminder = input("What would you like to be reminded about?: ")
date = input('When is that due?:')
add_reminder(reminder, date, PoliteReminder)
list_reminders()
else:
print("Invalid menu option")
return True
def print_menu():
print()
print('|--------------|')
print('| Pluralsight |')
print('| Reminders |')
print('| App |')
print('|--------------|')
print('* * * * * * * * *')
print('Please select an option:')
print()
print('1) List reminders')
print('2) Add a reminder')
print('3) Exit')
def main():
print_menu()
while handle_input():
print_menu()
if __name__ == '__main__':
main()