def maybe_show_preview(self) -> 'IO': if len(self.all_images) > 1: tracker = self._update_tracker() loc = TERM.get_location() for image in self.all_images[self.current_page + 1:][:4]: tracker.update(image) printer.move_cursor_xy(loc[0], loc[1]) self.preview_images = tracker.images
def start_preview(self): self.loc = TERM.get_location() if config.check_image_preview() and self.number_of_pages > 1: self.event = threading.Event() # Reset event, in case if it's set threading.Thread(target=self.preview).start()