implemented classes to remove global file

This commit is contained in:
piair
2024-02-27 14:52:55 +01:00
parent 3c9d20891c
commit 9857607eb3
17 changed files with 411 additions and 346178 deletions

32
modules/Tools/tools.py Normal file
View File

@ -0,0 +1,32 @@
from time import sleep
# return current page domain
def get_domain(driver):
return driver.current_url.split("/")[2]
def custom_sleep(temps):
try:
if True: # todo: change this awful condition
points = ["", "", "", "", "", "", "", ""]
passe = 0
for i in range(int(temps)):
for _ in range(8):
sleep(0.125)
passe += 0.125
print(f"{points[i]} - {round(float(temps) - passe, 3)}", end="\r")
print(" ", end="\r")
else:
sleep(temps)
except KeyboardInterrupt:
print("attente annulée")
def format_error(e) -> str:
tb = e.__traceback__
txt = ""
while tb is not None:
txt = txt + f" -> {tb.tb_frame.f_code.co_name} ({tb.tb_lineno}) "
tb = tb.tb_next
return txt + "\n" + str(e)