you can now cancel sleep

This commit is contained in:
piair 2022-06-21 17:22:44 +02:00
parent 3376eaf8ac
commit a3dcf15f7d
1 changed files with 34 additions and 25 deletions

23
V4.py
View File

@ -229,8 +229,8 @@ def printf(txt, end="", Mobdriver=driver):
def CustomSleep(temps):
try :
if Log or not IsLinux: #only print sleep when user see it
c = False
points = [
" . ",
" . ",
@ -245,14 +245,14 @@ def CustomSleep(temps):
for i in range(int(temps)):
for i in range(8):
sleep(0.125)
passe =+ 0.125
print(f"{points[i]} {float(temps) - passe}", end="\r")
passe += 0.125
print(f"{points[i]} - {round(float(temps) - passe, 3)}", end="\r")
print(" ", end="\r")
else:
sleep(temps)
except KeyboardInterrupt :
printf("attente annulée")
def ListTabs(Mdriver=None):
tabs = []
@ -438,7 +438,9 @@ def PlayQuiz4(override=None):
raise ValueError(e)
printf("PlayQuiz4 : end")
"""
PlayPoll() reply a random thing to poll
"""
def PlayPoll():
printf("PlayPoll : start")
try:
@ -541,12 +543,19 @@ def AllCard(): # fonction qui clique sur les cartes
driver.refresh()
"""
send_keys_wait([selenium element:element, str:keys]) send the different keys to the field element, with a random time between each press to simulate human action.
keys can be an string, but alos selenium keys
"""
def send_keys_wait(element, keys):
for i in keys:
element.send_keys(i)
sleep(uniform(0.1, 0.3))
"""
login() tries to login to your micrososft account.
it uses global variable _mail and _password to login
"""
def login():
global driver
printf("login : start")