-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.py
71 lines (62 loc) · 2.4 KB
/
main.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
import platform
from animation_controller import play_cool_cat_animation
from console_helper import display_menu
# Conditional import based on the OS
if platform.system() == "Windows":
from os_updaters import windows as os_updater
elif platform.system() in ["Linux", "Darwin"]:
from os_updaters import linux_macos as os_updater
else:
print("Unsupported OS detected. Exiting...")
input("Press Enter to exit.")
exit(1)
SPICETIFY_INSTALLED = os_updater.is_spicetify_installed()
from os import environ
environ["PYGAME_HIDE_SUPPORT_PROMPT"] = "1"
def main():
if not SPICETIFY_INSTALLED:
user_choice = input(
"Spicetify is not installed. Would you like to install it? (Y/N): "
).lower()
if user_choice == "y":
os_updater.install_spicetify()
print("Spicetify has been installed.")
else:
print("Spicetify installation skipped.")
return # Exit the program if Spicetify isn't installed and the user chooses not to install it.
# Now check if Spicetify is up to date.
if not os_updater.is_spicetify_up_to_date():
user_choice = input(
"An update for Spicetify is available. Would you like to update? (Y/N): "
).lower()
if user_choice == "y":
os_updater.install_spicetify()
print("Spicetify has been updated.")
else:
print("Spicetify update skipped.")
# Main menu
while True:
if SPICETIFY_INSTALLED:
options = ["Reinstall/Update Spicetify", "See a cool cat animation"]
user_choice = display_menu(options)
if user_choice == "1":
os_updater.install_spicetify()
elif user_choice == "2":
play_cool_cat_animation()
elif user_choice == "3":
print("Exiting...")
break # Exit the while loop to terminate the program
else:
print("Invalid option. Please try again.")
else:
options = ["Install Spicetify", "See a cool cat animation"]
user_choice = display_menu(options)
if user_choice == "1":
os_updater.install_spicetify()
elif user_choice == "2":
play_cool_cat_animation()
elif user_choice == "3":
print("Exiting...")
break
if __name__ == "__main__":
main()