def quoteOSHPark(self): """Function for navigating OSHPark's website.""" url, user, pw = self.readConfig('oshpark', 'rigid') # Open new tab and go to URL self.newTab() self.driver.get(url) # Enter login information self.driver.find_element_by_css_selector('#user_email').send_keys(user) self.driver.find_element_by_css_selector('#user_password').send_keys(pw) # Click login button self.driver.find_element_by_css_selector('.buttons > input:nth-child(1)').click() self.driver.find_element_by_css_selector('#ember291').click() self.driver.find_element_by_css_selector('#file_selector > input:nth-child(2)').click() e = EWMH() windows = e.getClientList() for window in windows: if e.getWmName(window) == 'File Upload': time.sleep(0.5) e.setActiveWindow(window) e.display.flush() time.sleep(0.5) pyautogui.hotkey('ctrl', 'a') pyautogui.press('backspace') # '''get file location from config file''' # pyautogui.typewrite(fileLocation) pyautogui.press('return')
def runLinuxMinimize(command, args): from ewmh import EWMH ewmh = EWMH() win = ewmh.getActiveWindow() args.insert(0, command) subprocess.call(args) ewmh.setActiveWindow(win) ewmh.display.flush()
from ewmh import EWMH ewmh = EWMH() def filter_window(wins, windowclass): for w in wins: if w.get_wm_class()[1] == windowclass: return w wins = ewmh.getClientList() user_input = raw_input("Enter a Valid Input:") diawin = filter_window(wins, 'Dia-normal') ewmh.setActiveWindow(diawin) if user_input == "1": ewmh.setWmState(diawin, 1, '_NET_WM_STATE_FULLSCREEN') ewmh.display.flush()