def finish_key(self): """Presses the Finish button using the keyboard.""" self._ensure(running=True) self._ensure_button('Finish') _LOGGER.info('closing installer') self.setFocus() SCREEN.type('f', KEY_ALT) sleep(1) self.running = False
def finish_key(self): """Presses the Finish button using the keyboard.""" self._ensure(running = True) self._ensure_button('Finish') _LOGGER.info('closing installer') self.setFocus() SCREEN.type('f', KEY_ALT) sleep(1) self.running = False
def typeKeys(keys, modifiers = NO_MODIFIER, repeat = 1, region = None): """Types a sequence of keys. If repeat is greater than 1, types the same sequence repeatedly. If region is not None, clicks on the region first. """ if repeat < 1: return # click on the region only once SCREEN.type(region, keys, modifiers) for i in range(repeat - 1): SCREEN.type(keys, modifiers)
def install_key(self): """Presses the install button using the keyboard. Raises Exception if the installer is not on the 'Ready to Install' page. """ self._ensure(running=True) self._ensure_button('Install') self.setFocus() SCREEN.type('i', KEY_ALT) sleep(1) self.page = self.installing_page self.installing = True self.buttons_valid = False
def back_key(self): """Presses the Back button using the keyboard. Raises Exception if the Back button is not enabled. """ self._ensure(running=True) self._ensure_button('Back') self._ensure_button_enabled('Back') self.setFocus() SCREEN.type('b', KEY_ALT) sleep(1) self.page -= 1 self.buttons_valid = False _LOGGER.info('now on %s page', self.pages[self.page])
def install_key(self): """Presses the install button using the keyboard. Raises Exception if the installer is not on the 'Ready to Install' page. """ self._ensure(running = True) self._ensure_button('Install') self.setFocus() SCREEN.type('i', KEY_ALT) sleep(1) self.page = self.installing_page self.installing = True self.buttons_valid = False
def back_key(self): """Presses the Back button using the keyboard. Raises Exception if the Back button is not enabled. """ self._ensure(running = True) self._ensure_button('Back') self._ensure_button_enabled('Back') self.setFocus() SCREEN.type('b', KEY_ALT) sleep(1) self.page -= 1 self.buttons_valid = False _LOGGER.info('now on %s page', self.pages[self.page])
def cancel_key(self): """Presses the Cancel button and confirms using the keyboard. Raises Exception if the Cancel button is not enabled. """ self._ensure(running=True) self._ensure_button('Cancel') self._ensure_button_enabled('Cancel') self.setFocus() SCREEN.type(Key.ESC) sleep(1) SCREEN.type('y') sleep(1) self.page = self.cancelled_page self.installing = False self.buttons_valid = False
def cancel_key(self): """Presses the Cancel button and confirms using the keyboard. Raises Exception if the Cancel button is not enabled. """ self._ensure(running = True) self._ensure_button('Cancel') self._ensure_button_enabled('Cancel') self.setFocus() SCREEN.type(Key.ESC) sleep(1) SCREEN.type('y') sleep(1) self.page = self.cancelled_page self.installing = False self.buttons_valid = False
def _close(self, button_id=None): """Closes the actual confirmation dialogue represented by this instance. """ if button_id is None: DialogueWindow._close(self, button_id) return if button_id not in self.button_ids: raise Exception("confirm dialogue '%s' does not contain a button with id %s" % (self.name, button_id)) if self.keys is not None: SCREEN.type(self.keys[button_id]) sleep(1) else: button = self.buttons[button_id] if isinstance(button, list): clickAny(button) else: SCREEN.click(button) sleep(1)
def _close(self, button_id = None): """Closes the actual confirmation dialogue represented by this instance. """ if button_id is None: DialogueWindow._close(self, button_id) return if button_id not in self.button_ids: raise Exception("confirm dialogue '%s' does not contain a button with id %s" % (self.name, button_id)) if self.keys is not None: SCREEN.type(self.keys[button_id]) sleep(1) else: button = self.buttons[button_id] if isinstance(button, list): clickAny(button) else: SCREEN.click(button) sleep(1)