mirror of
https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
synced 2025-06-19 09:34:45 +02:00
implemented classes to remove global file
This commit is contained in:
32
modules/Tools/tools.py
Normal file
32
modules/Tools/tools.py
Normal 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)
|
Reference in New Issue
Block a user