Пример #1
0
 def show_available_tile(self):
     batch = App.get_running_app().root.ids.triage_batch_spinner.text
     next_object, next_tile_id = get_left_object(batch, self.current_tile_id,
                                                 ignore_committed=self.ignore_committed,
                                                 ignore_discarded=self.ignore_discarded)
     triage_area = App.get_running_app().root.ids.triage_area
     triage_area.clear_widgets()
     if not next_object or not next_tile_id:
         next_object, next_tile_id = get_right_object(batch, self.current_tile_id,
                                                      ignore_committed=self.ignore_committed,
                                                      ignore_discarded=self.ignore_discarded)
     if next_object and next_tile_id:
         self.current_object, self.current_tile_id = next_object, next_tile_id
         self.update_triage_area(triage_area)
     else:
         self.current_object, self.current_tile_id = None, None
         App.get_running_app().root.ids.triage_batch_spinner.text = '(select batch)'
Пример #2
0
    def on_keyboard_down(self, keyboard, keycode, text, modifiers):

        if self.get_current_tab().text == 'Tile Triage':
            triage_area = App.get_running_app().root.ids.triage_area
            batch = App.get_running_app().root.ids.triage_batch_spinner.text
            if batch != '(select batch)':
                if keycode[1] == 'left':
                    next_object, next_tile_id = get_left_object(batch, self.current_tile_id,
                                                                ignore_committed=self.ignore_committed,
                                                                ignore_discarded=self.ignore_discarded)
                    if next_object and next_tile_id:
                        triage_area.clear_widgets()
                        self.current_object, self.current_tile_id = next_object, next_tile_id
                        self.update_triage_area(triage_area)
                elif keycode[1] == 'right':
                    next_object, next_tile_id = get_right_object(batch, self.current_tile_id,
                                                                 ignore_committed=self.ignore_committed,
                                                                 ignore_discarded=self.ignore_discarded)
                    if next_object and next_tile_id:
                        triage_area.clear_widgets()
                        self.current_object, self.current_tile_id = next_object, next_tile_id
                        self.update_triage_area(triage_area)
                elif keycode[1] == 'up':
                    next_object, next_tile_id = get_up_object(batch, self.current_tile_id,
                                                              ignore_committed=self.ignore_committed,
                                                              ignore_discarded=self.ignore_discarded)
                    if next_object and next_tile_id:
                        triage_area.clear_widgets()
                        self.current_object, self.current_tile_id = next_object, next_tile_id
                        self.update_triage_area(triage_area)
                elif keycode[1] == 'down':
                    next_object, next_tile_id = get_down_object(batch, self.current_tile_id,
                                                                ignore_committed=self.ignore_committed,
                                                                ignore_discarded=self.ignore_discarded)
                    if next_object and next_tile_id:
                        triage_area.clear_widgets()
                        self.current_object, self.current_tile_id = next_object, next_tile_id
                        self.update_triage_area(triage_area)
                else:
                    return False
        return True