This is used to exec the idle function in a safe context and a separate thread
(self)
| 453 | raise NotImplementedError("Applications must implement 'main()' function.") |
| 454 | |
| 455 | def _idle_loop(self): |
| 456 | """ This is used to exec the idle function in a safe context and a separate thread |
| 457 | """ |
| 458 | while not self._stop_update_flag: |
| 459 | time.sleep(self.update_interval) |
| 460 | with self.update_lock: |
| 461 | try: |
| 462 | self.idle() |
| 463 | except Exception: |
| 464 | self._log.error("exception in App.idle method", exc_info=True) |
| 465 | if self._need_update_flag: |
| 466 | try: |
| 467 | self.do_gui_update() |
| 468 | except Exception: |
| 469 | self._log.error('''exception during gui update. It is advisable to |
| 470 | use App.update_lock using external threads.''', exc_info=True) |
| 471 | |
| 472 | def idle(self): |
| 473 | """ Idle function called every UPDATE_INTERVAL before the gui update. |
nothing calls this directly
no test coverage detected