def hi(): KeyboardUtil.setDefaultLanguage() storedClipboard = beforeSetClipboard() sendText("Hi ,") sendKey("Return Return Return Return") sendText("Regards,") sendKey("Return") sendText(Common.NAME) sendKey("Up Up Up Up Up End Left") afterSetClipboard(storedClipboard)
def newTask(): """ Sends a task template """ KeyboardUtil.setDefaultLanguage() output = datetime.datetime.now().strftime("%Y%m%d%H%M%S") Tk().withdraw() text = tkSimpleDialog.askstring('Task category', 'Category::') if text is None or text == "": sys.exit() #works as well #time.sleep(0.24) #output = system.exec_command("date +%Y%m%d%H%M%S") #time = output.stdout.readline() storedClipboard = ClipboardUtil.pasteFromClipboardXsel() sendText("task " + text + "\n" + " " + output + " " + "\n\n" + "solution" + "\n\n" + "info" + "\n\n" + "keywords") sendKey("Home Up Up Up Up Up Up End") ClipboardUtil.copyToClipboardXclip(storedClipboard)
def gnomeTerminal(): KeyboardUtil.setDefaultLanguage() Common.openProcess('gnome-terminal', 'at@at-arch-laptop', '', '')
def search(keyword): KeyboardUtil.setDefaultLanguage() open() scanForKeyword() if keyword != "": SendToUi.sendKey(keyword)
def hitControF5(self, browser) : # body = browser.find_element_by_tag_name('body') # webdriver.ActionChains(browser).key_down(Keys.CONTROL, body).send_keys(Keys.F5).key_up(Keys.CONTROL, body).perform() browser.switch_to.window(browser.current_window_handle) KeyboardUtil.ctrlF5()
def hitControlV(self, browser, element=None) : webdriver.ActionChains(browser).key_down(Keys.CONTROL, element).send_keys('v').key_up(Keys.CONTROL, element).perform() time.sleep(BrowserConstants.DEFAULT_WEBDRIVER_DELAY_FRACTION) KeyboardUtil.esc()