fix: match not supported before python 3.10

This commit is contained in:
Sayantan Santra 2023-08-10 22:30:12 -05:00
parent 7169cc79e2
commit 37b4d1e172
Signed by: SinTan1729
GPG key ID: EB3E68BFBA25C85F

View file

@ -44,8 +44,7 @@ def send_notif(appstate, error=False):
continue continue
encoded_title = '⚙⚙⚙ ReVanced Build ⚙⚙⚙'.encode('utf-8') encoded_title = '⚙⚙⚙ ReVanced Build ⚙⚙⚙'.encode('utf-8')
match entry: if entry == 'ntfy':
case 'ntfy':
print('Sending notification through ntfy.sh...') print('Sending notification through ntfy.sh...')
try: try:
url = config[entry]['url'] url = config[entry]['url']
@ -60,7 +59,7 @@ def send_notif(appstate, error=False):
except Exception as e: except Exception as e:
print('Failed!' + str(e)) print('Failed!' + str(e))
case 'gotify': elif entry == 'gotify':
print('Sending notification through Gotify...') print('Sending notification through Gotify...')
try: try:
url = config[entry]['url'] url = config[entry]['url']
@ -74,7 +73,7 @@ def send_notif(appstate, error=False):
except Exception as e: except Exception as e:
print('Failed!' + str(e)) print('Failed!' + str(e))
case 'telegram': elif entry == 'telegram':
print('Sending notification through Telegram...') print('Sending notification through Telegram...')
try: try:
chat = config[entry]['chat'] chat = config[entry]['chat']
@ -92,5 +91,5 @@ def send_notif(appstate, error=False):
except Exception as e: except Exception as e:
clean_exit(f"Failed!\n{e}", appstate) clean_exit(f"Failed!\n{e}", appstate)
case _: else:
print('Don\'t know how to send notifications to ' + entry) print('Don\'t know how to send notifications to ' + entry)