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)
def click(self, name): """Clicks the specified button. """ i, match = self._button_matches[name] _LOGGER.info("%sclick '%s': %s", self._debugprefix, name, str(match)) SCREEN.click(match, NO_MODIFIER)
def close(self): """Clicks on the close button in this window's title bar.""" _LOGGER.debug('close window: %s', self.title) SCREEN.click(self.close_button)
def maximize(self): """Clicks on the maximize button in this window's title bar.""" _LOGGER.debug('maximize window: %s', self.title) SCREEN.click(self.maximize_button)
def setFocus(self): """Clicks on the center of this window's title bar.""" _LOGGER.debug('setFocus: %s', self.title) SCREEN.click(self.titlebar_region)