def __animate_progress(self):
     """Function that changes the status message, i.e animates progress."""
     while True:
         if self.__show_animation:
             SublBridge.set_status(Tools.generate_next_progress_message())
             time.sleep(ThreadPool.__progress_update_delay)
         else:
             SublBridge.set_status(READY_MSG)
             time.sleep(ThreadPool.__progress_idle_delay)
예제 #2
0
 def test_cursor_pos(self):
     """Test cursor position."""
     self.setText("hello")
     (row, col) = SublBridge.cursor_pos(self.view)
     self.assertEqual(row, 1)
     self.assertEqual(col, 6)
     self.setText("\nworld!")
     (row, col) = SublBridge.cursor_pos(self.view)
     self.assertEqual(row, 2)
     self.assertEqual(col, 7)
     self.move(10, forward=False)
     (row, col) = SublBridge.cursor_pos(self.view)
     self.assertEqual(row, 1)
     self.assertEqual(col, 3)
예제 #3
0
 def test_next_line(self):
     """Test returning next line."""
     self.setText("hello\nworld!")
     self.move(10, forward=False)
     next_line = SublBridge.next_line(self.view)
     self.assertEqual(next_line, "world!")