This can be called from the main thread to safely stop this thread. Note that it does not attempt to write out remaining history before exiting. That should be done by calling the HistoryManager's end_session method.
(self)
| 837 | "History will not be written to the database.") % repr(e)) |
| 838 | |
| 839 | def stop(self): |
| 840 | """This can be called from the main thread to safely stop this thread. |
| 841 | |
| 842 | Note that it does not attempt to write out remaining history before |
| 843 | exiting. That should be done by calling the HistoryManager's |
| 844 | end_session method.""" |
| 845 | self.stop_now = True |
| 846 | self.history_manager.save_flag.set() |
| 847 | self.join() |
| 848 | |
| 849 | |
| 850 | # To match, e.g. ~5/8-~2/3 |