Advertisement
Guest User

Untitled

a guest
Jul 29th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.16 KB | None | 0 0
  1. --- a/gui/qt/util.py
  2. +++ b/gui/qt/util.py
  3. @@ -546,18 +546,27 @@ class TaskThread(QThread):
  4.          while True:
  5.              task = self.tasks.get()
  6.              if not task:
  7. +                print('No task. Stopping TaskThread.')
  8.                  break
  9. +            print('Retrieved task from queue.')
  10.              try:
  11. +                print('Running task...')
  12.                  result = task.task()
  13. +                print('Ran task without error.')
  14.                  self.doneSig.emit(result, task.cb_done, task.cb_success)
  15. -            except BaseException:
  16. +            except BaseException as e:
  17. +                print('Caught exception %s' % str(e))
  18. +                print('Calling on_error() with exception info...')
  19.                  self.doneSig.emit(sys.exc_info(), task.cb_done, task.cb_error)
  20.  
  21.      def on_done(self, result, cb_done, cb):
  22. +        print('Determining which callback to call...')
  23.          # This runs in the parent's thread.
  24.          if cb_done:
  25. +            print('    Calling on_done()')
  26.              cb_done()
  27.          if cb:
  28. +            print('    Calling callback with result')
  29.              cb(result)
  30.  
  31.      def stop(self):
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement