def _loader_thread(self, logpath, session_name, session_notes): Clock.schedule_once(lambda dt: self.dispatch('on_import_start')) success = True message = '' session_id = None try: session_id = self.datastore.import_datalog(logpath, session_name, session_notes, self._update_progress) except Exception as e: success = False message = str(e) ExceptionManager.handle_exception(e) Clock.schedule_once(lambda dt: self.dispatch('on_import_complete', session_id, success, message))
def _loader_thread(self, logpath, session_name, session_notes): Clock.schedule_once(lambda dt: self.dispatch('on_import_start')) success = True message = '' session_id = None try: session_id = self.datastore.import_datalog(logpath, session_name, session_notes, self._update_progress) except Exception as e: success = False message = str(e) ExceptionManager.handle_exception(e) Clock.schedule_once(lambda dt: self.dispatch( 'on_import_complete', session_id, success, message))
def mainloop(self): while not EventLoop.quit and EventLoop.status == 'started': try: self._mainloop() except BaseException as inst: # use exception manager first r = ExceptionManager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass
def mainloop(self): while not EventLoop.quit and EventLoop.status == 'started': try: self._mainloop() if not pygame.display.get_active(): pygame.time.wait(100) except BaseException as inst: # use exception manager first r = ExceptionManager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass
def mainloop(self): while not EventLoop.quit and EventLoop.status == 'started': try: self._mainloop() if not pygame.display.get_active(): pygame.time.wait(100) except BaseException, inst: # use exception manager first r = ExceptionManager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass
async def async_mainloop(self): from kivy.base import ExceptionManager, stopTouchApp while not self.quit and self.status == 'started': try: await self.async_idle() if self.window: self.window.mainloop() except BaseException as inst: # use exception manager first r = ExceptionManager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass
def mainloop(self): # don't known why, but pygame required a resize event # for opengl, before mainloop... window reinit ? #self.dispatch('on_resize', *self.size) while not EventLoop.quit and EventLoop.status == 'started': try: self._mainloop() except BaseException as inst: # use exception manager first r = ExceptionManager.handle_exception(inst) if r == ExceptionManager.RAISE: stopTouchApp() raise else: pass
def handle_exception(self, e): from kivy.base import ExceptionManager if ExceptionManager.handle_exception(e) == ExceptionManager.RAISE: raise