View Single Post
Old 06-20-2014, 03:19 PM   #1
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Class ThreadedJob(BaseJob) Does Not Consume Notification Progress Queue Items?

Although the documentation comments in Class ThreadedJob(Basejob) state that notifications are a queue that should be .put in a tuple such as (0.01,"working"), that does not seem to work for me. I can see no code in that Class that consumes progress notifications. However, I do find it in Class ThreadedJobServer(Thread). How can a single threaded job submitted via Class ThreadedJob submit progress notifications so the job viewer does not say that the progress bar is "Unavailable"?

The code I am testing in main.py invoked by jobs.py is:

notifications = Queue()

def run_my_process(self, guidb, log=None, abort=None, notifications=True):
notifications.put(0.02, 'Not Unavailable')

Using notifications=notifications instead of =True does not work either. Neither does =None.

My plugin job runs and finishes perfectly with the exception that progress notifications are not working. Perhaps the documentation regarding notifications (specifically for use in job progress feedback) in Class ThreadedJob within threaded_jobs.py could be clarified by someone?

The current Calibre Class ThreadedJob comments: notifications
is a Queue. func should put progress notifications into it in the form
of a tuple (frac, msg). frac is a number between 0 and 1 indicating
progress and msg is a string describing the progress.



Thank you in advance.

Last edited by DaltonST; 06-20-2014 at 05:48 PM.
DaltonST is offline   Reply With Quote