-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabel_manager.py
34 lines (32 loc) · 1.09 KB
/
label_manager.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
from get_labels import get_labels
from create_label import create_label
from delete_label import delete_label
from update_label import update_label
def manage_labels():
while True:
print("\nLabel Manager Menu:")
print("1. List Labels")
print("2. Create a Label")
print("3. Delete a Label")
print("4. Update a Label")
print("5. Go back to the main menu")
choice = input("Enter your choice: ")
try:
if choice == '1':
get_labels()
elif choice == '2':
create_label()
elif choice == '3':
delete_label()
elif choice == '4':
update_label()
elif choice == '5':
break # Exit the loop to go back to the main menu
else:
print("Invalid choice. Please enter a number between 1 and 5.")
except Exception as e:
if str(e) == "Return to previous menu":
print("Returning to the previous menu...")
break
else:
raise e