comparison frontends/src/jp/base.py @ 1918:01d56efd488b

jp: fixed traceback shown on a normal quit when a progression is finished
author Goffi <goffi@goffi.org>
date Mon, 21 Mar 2016 19:44:16 +0100
parents 0fe69871b71f
children 2c75011d7b2d
comparison
equal deleted inserted replaced
1917:05a5a125a238 1918:01d56efd488b
270 """Same as self.quit, but from a signal handler 270 """Same as self.quit, but from a signal handler
271 271
272 /!\: return must be used after calling this method ! 272 /!\: return must be used after calling this method !
273 """ 273 """
274 assert self._need_loop 274 assert self._need_loop
275 # XXX: python-dbus will show a traceback if we exit in a signal handler with an error code 275 # XXX: python-dbus will show a traceback if we exit in a signal handler
276 # so we use this little timeout trick to avoid it 276 # so we use this little timeout trick to avoid it
277 GLib.timeout_add(0, self.quit, errcode) 277 GLib.timeout_add(0, self.quit, errcode)
278 278
279 def quit(self, errcode=0): 279 def quit(self, errcode=0):
280 # first the onQuitCallbacks 280 # first the onQuitCallbacks
494 self.host.pbar.finish() 494 self.host.pbar.finish()
495 except AttributeError: 495 except AttributeError:
496 pass 496 pass
497 self.onProgressFinished(metadata) 497 self.onProgressFinished(metadata)
498 if self.host.quit_on_progress_end: 498 if self.host.quit_on_progress_end:
499 self.host.quit() 499 self.host.quitFromSignal()
500 500
501 def progressErrorHandler(self, uid, message, profile): 501 def progressErrorHandler(self, uid, message, profile):
502 if profile != self.profile: 502 if profile != self.profile:
503 return 503 return
504 if uid == self.progress_id: 504 if uid == self.progress_id: