From 216c036441047a87d66a4a10ecc8f7f8a2e21d16 Mon Sep 17 00:00:00 2001 From: piair Date: Thu, 17 Feb 2022 10:39:21 +0100 Subject: [PATCH] remove Python3.10 functions --- V4.py | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) diff --git a/V4.py b/V4.py index 613df6e..f405b17 100644 --- a/V4.py +++ b/V4.py @@ -567,30 +567,29 @@ def TryPlay(nom ="inconnu"): RGPD() def play(number, override = None) : - match number : - case 9 | 8 : - try : - print(f'Quiz 8 détécté sur la page {nom}') - RGPD() - PlayQuiz8(override) - except Exception as e : - printf(f'echec de PlayQuiz 8. Aborted {e}') - case 5 | 4 : - try : - print(f'Quiz 4 détécté sur la page {nom}') - RGPD() - PlayQuiz4(override) - print('Quiz 4 reussit') - except Exception as e : - printf(f'echec de PlayQuiz 4. Aborted {e}') - case 3 | 2 : - try : - RGPD() - print(f'Quiz 2 détécté sur la page {nom}') - PlayQuiz2(override) - except Exception as e : - printf(f'echec de PlayQuiz 2. Aborted {e}') - case _ : + if number == 8 or number == 9 : + try : + print(f'Quiz 8 détécté sur la page {nom}') + RGPD() + PlayQuiz8(override) + except Exception as e : + printf(f'echec de PlayQuiz 8. Aborted {e}') + elif number == 5 or number == 4 : + try : + print(f'Quiz 4 détécté sur la page {nom}') + RGPD() + PlayQuiz4(override) + print('Quiz 4 reussit') + except Exception as e : + printf(f'echec de PlayQuiz 4. Aborted {e}') + elif number == 3 or number == 2 : + try : + RGPD() + print(f'Quiz 2 détécté sur la page {nom}') + PlayQuiz2(override) + except Exception as e : + printf(f'echec de PlayQuiz 2. Aborted {e}') + else : LogError('probleme dans la carte : il y a un bouton play et aucun quiz') try : driver.find_element(By.ID, 'rqStartQuiz').click() #start the quiz