def block(self): """Block until there are no pending actions. Only used in the automated testing suite. """ _block(lambda: self.task_logger.has_finished() and not self._is_busy) assert not self._is_busy _wait(50)
def _on_action(self, sender, name, *args): """Called when an action is triggered: enqueue and process the task.""" assert sender == self.action_creator # The GUI should not be busy when calling a new action. if 'select' not in name and self._is_busy: logger.log(5, "The GUI is busy, waiting before calling the action.") _block(lambda: not self._is_busy) # Enqueue the requested action. self.task_logger.enqueue(self, name, *args) # Perform the action (which calls self.<name>(...)). self.task_logger.process()