Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pyautogui as pag
- import time
- """
- Input the basic info on the Header Tab for order ASNs in portal
- OUTLINE
- _________________________________________
- Introduction
- Loop:
- User asked for order_info
- submit supplied order_info to ASN Header
- Loop:
- User asked
- '''
- Hit enter to enter information to ASN Header
- Type 'new' to enter new information
- Type 'exit' to exit
- '''
- """
- carrier_dd_list = ['dayton', 'central t', 'fedex freight ltl priority', 'taxa',
- 'roadrunner', ]
- order_info = {}
- # def carrier_code_selection(x): # will I even use this?
- def tab(x):
- for i in range(x+1):
- pag.press('tab')
- def exit_option():
- exit_query = input("Type 'exit' to exit the program or hit enter to "
- "continue. ")
- if exit_query.lower() == 'exit':
- quit()
- sxe_header_field_positions = {
- 'gross weight': (410,619),
- }
- def order_info_grab():
- order_info = {
- 'weight': input("Weight: \n-> "),
- 'carrier dropdown': input(f"Carrier Selection - (Type one of the "
- f"following:\n"
- f"{carrier_dd_list}\nCarrier: \n-> "),
- 'scac': input('SCAC or "Carrier Name": '),
- # 'equipment number': 69,
- 'bill of lading': input("Bill of Lading #: \n-> "),
- 'pro number': input("Pro #: \n-> "),
- 'ship date': input("Ship date MM/DD/YYYY format \n-> ")
- }
- def entry_to_header():
- pag.moveTo(sxe_header_field_positions['gross weight'])
- time.sleep(.4)
- pag.click()
- time.sleep(.4)
- pag.write(order_info['weight'])
- time.sleep(.4)
- tab(1)
- pag.write(order_info['carrier dropdown'])
- tab(1)
- pag.write(order_info['scac'])
- tab(1)
- pag.write('69')
- tab(1)
- pag.write(order_info['bill of lading'])
- tab(1)
- pag.write(order_info['pro number'])
- tab(1)
- pag.write(order_info['ship date'])
- tab(2),pag.press('c')
- tab(11)
- pag.write('Company Name')
- pag.scroll(4000) # just to get to the top of the page again
- def order_info_change():
- for key, value in order_info.items():
- if key != 'equipment number':
- change_y_n = input(f"would you like to change the "
- f"{key.title()}? Type 'y' to change or hit enter to "
- f"skip the change.\n-> ")
- if change_y_n.lower() in ('y','yes','yeah'):
- order_info[key] = input(f"New {key.title()}: \n-> ")
- else:
- continue
- order_info_grab()
- while True:
- entry_to_header()
- # # TODO enter the user supplied info to the ASN header
- while True:
- begin_or_change = input('We are about to start a new loop and enter '
- 'the order information into the ASN Header '
- 'tab. \nBe sure the page is open '
- 'and is set to zoom level 100%. \nIf you need to change the '
- 'order information, please type "new" or you can just hit '
- 'enter to start the loop with the previous information.\n-> ')
- if begin_or_change.lower() == 'new':
- order_info_grab()
- elif begin_or_change.lower() == '':
- break
- else:
- print("That's invalid. Try again: ")
- exit_option()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement