Add lead checking
This commit is contained in:
@@ -17,9 +17,9 @@ def assign_urls(dictionary):
|
||||
value = input(f"Enter url for '{key}': ")
|
||||
dictionary[key] = value
|
||||
|
||||
def get_team():
|
||||
def get_team(name):
|
||||
user_list = []
|
||||
print("What are the usernames?")
|
||||
print(f"List {name} members.")
|
||||
while True:
|
||||
user_input = input("Add to list (Press Enter to finish): ")
|
||||
if user_input:
|
||||
@@ -45,9 +45,12 @@ def first_time_setup():
|
||||
assign_urls(urls)
|
||||
with open('urls.json', 'w') as file:
|
||||
json.dump(urls, file)
|
||||
users = get_team()
|
||||
users = get_team("users")
|
||||
leads = get_team("leads")
|
||||
with open('team.json', 'w') as file:
|
||||
json.dump(users, file)
|
||||
with open('leads.json', 'w') as file:
|
||||
json.dump(leads, file)
|
||||
|
||||
def show_loading_bar(duration):
|
||||
start_time = time.time()
|
||||
@@ -83,12 +86,20 @@ def main():
|
||||
end_time = datetime.time(17, 0, 0)
|
||||
weekday = datetime.datetime.now().weekday()
|
||||
if start_time <= current_time <= end_time and weekday < 5:
|
||||
while len(driver.window_handles) > 1:
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
driver.close()
|
||||
driver.switch_to.window(driver.window_handles[0])
|
||||
try:
|
||||
AutoTicket.auto_ticket(urls, users, driver)
|
||||
except Exception as e:
|
||||
print("An error occurred in AutoTicket.py")
|
||||
print(e)
|
||||
print(traceback.format_exc())
|
||||
while len(driver.window_handles) > 1:
|
||||
driver.switch_to.window(driver.window_handles[1])
|
||||
driver.close()
|
||||
driver.switch_to.window(driver.window_handles[0])
|
||||
try:
|
||||
AutoColor2.tag_assist(urls, driver, users)
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user