Exemple #1
0
 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
Exemple #2
0
 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
Exemple #3
0
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)
Exemple #4
0
 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
Exemple #5
0
 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])
Exemple #6
0
 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
Exemple #7
0
 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])
Exemple #8
0
 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
Exemple #9
0
 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
Exemple #10
0
 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)
Exemple #11
0
 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)