mirror of
https://gitea.augustin64.fr/piair/MsRewards-Reborn.git
synced 2025-06-12 22:24:47 +02:00
I need a better solution
This commit is contained in:
@ -8,8 +8,9 @@ from discord import ( # Importing discord.Webhook and discord.RequestsWebhookAd
|
||||
)
|
||||
|
||||
from modules.config import *
|
||||
global _mail
|
||||
|
||||
_mail = "undefined"
|
||||
|
||||
"""
|
||||
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
|
||||
@ -22,7 +23,8 @@ def send_keys_wait(element, keys):
|
||||
else :
|
||||
sleep(uniform(0.1, 0.3))
|
||||
|
||||
def LogError(message, driver,_mail, log=FULL_LOG):
|
||||
|
||||
def LogError(message, driver, _mail, log=FULL_LOG):
|
||||
print(f"\n\n\033[93m Erreur : {str(message)} \033[0m\n\n")
|
||||
if DISCORD_ENABLED_ERROR:
|
||||
with open("page.html", "w") as f:
|
||||
@ -50,19 +52,17 @@ def LogError(message, driver,_mail, log=FULL_LOG):
|
||||
|
||||
|
||||
|
||||
|
||||
# add the time arround the text given in [text]
|
||||
# [text] : string
|
||||
def Timer(text="undefined"):
|
||||
def Timer(text="undefined", mail=_mail):
|
||||
return(f"[{_mail} - {timedelta(seconds = round(float(time() - START_TIME)))}] " + str(text))
|
||||
|
||||
|
||||
# replace the function print, with more options
|
||||
# [txt] : string, [driver] : selenium wbdriver
|
||||
def printf(txt, LOG = LOG):
|
||||
def printf(txt, mail = _mail, LOG = LOG):
|
||||
if LOG:
|
||||
print(Timer(txt))
|
||||
|
||||
print(Timer(txt, _mail))
|
||||
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user