added overrite option

This commit is contained in:
piair 2022-02-14 16:48:57 +01:00
parent 32b8d757da
commit fa3bc93b87
1 changed files with 52 additions and 9 deletions

49
V4.py
View File

@ -754,6 +754,47 @@ def close():
quit() quit()
def CustomStart(Credentials):
global driver
driver = FirefoxPC()
ids = [x[0] for x in Credentials]
actions=["tout", "daily", "pc", "mobile"]
for i in range(len(ids)) :
print(f"{i} : {ids[i]}")
choice1 = int(input(""))
assert choice1 < len(ids)
for i in range(len(actions)) :
print(f"{i} : {actions[i]}")
choice2 = int(input(""))
assert choice2 < len(actions)
_mail =Credentials[choice1][0]
_password = Credentials[choice1][1]
if choice2 == 0 :
DailyRoutine()
elif choice2 == 1 :
try :
AllCard()
except Exception as e :
LogError(f'pas normal sauf si relancer a la main, juste pour les recherches bing (DalyRoutine -> AllCard) \n {e}. -- override')
elif choice2 == 2 :
try :
BingPcSearch()
except Exception as e :
LogError(f"il y a eu une erreur dans BingPcSearch, {e} -- override")
elif choice2 == 3 :
try :
BingMobileSearch()
except Exception as e:
LogError(f'BingMobileSearch - {e} -- override')
with open(LogPath) as f: with open(LogPath) as f:
reader = reader(f) reader = reader(f)
data = list(reader) data = list(reader)
@ -764,8 +805,10 @@ CustomSleep(2)
shuffle(Credentials) shuffle(Credentials)
if len(sys.argv) > 1 :
for i in Credentials : CustomStart(Credentials)
else :
for i in Credentials :
_mail =i[0] _mail =i[0]
@ -774,7 +817,7 @@ for i in Credentials :
print('\n\n') print('\n\n')
print(_mail) print(_mail)
CustomSleep(1) CustomSleep(1)
if main:
driver = FirefoxPC() driver = FirefoxPC()
driver.implicitly_wait(5) driver.implicitly_wait(5)