From dd56991f3714b47accd4f46b2b566b3cd7ee3e75 Mon Sep 17 00:00:00 2001 From: piair Date: Mon, 18 Apr 2022 09:25:51 +0200 Subject: [PATCH] oui --- V4.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/V4.py b/V4.py index 9cff32c..57f8f32 100755 --- a/V4.py +++ b/V4.py @@ -50,18 +50,16 @@ FullLog = args.fulllog IsLinux = platform == "linux" start_time = time() -driver = None global driver +driver = None def Timer(text="undefined"): - print(f"[{time() - start_time}] : ") + return(f"[{time() - start_time}] : " + text ) if IsLinux: import enquiries - - Timer() else: system("") # enable colors in cmd @@ -123,11 +121,13 @@ def FirefoxPC(Headless=Headless): def printf(txt, end="", Mobdriver=driver): if Log: - Timer(txt) + print(Timer(txt)) elif FullLog and Mobdriver: - LogError(txt, Mobdriver=Mobdriver) + LogError(Timer(txt), Mobdriver=Mobdriver) else : - print(txt, Mobdriver) + print(timer(txt), Mobdriver) + + def CustomSleep(temps): if Log or not IsLinux: c = False @@ -943,9 +943,9 @@ else: try: DailyRoutine() driver.quit() - timer = uniform(1200, 3600) - print(f"finis. attente de {round(timer/60)}min") - CustomSleep(timer) + attente = uniform(1200, 3600) + print(f"finis. attente de {round(attente/60)}min") + CustomSleep(attente) except KeyboardInterrupt: print("canceled")