Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Development

Notices

Reply
 
Thread Tools Search this Thread
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
Old 06-20-2014, 11:11 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,819
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You want

notifications.put((0.02, 'Not Unavailable'))

note the extra brackets.
kovidgoyal is offline   Reply With Quote
Advert
Reply

Tags
job, notification, plugin, progress, threadedjob

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PRS-650 SD Card Importance? SDHC, SDHC Class 4, Class 10 etc is it important Renji Sony Reader 11 12-03-2011 12:30 PM
Managing your library or how you consume books pwalker8 General Discussions 37 09-02-2010 07:58 AM
Marvell unveils 1 GHz chips that consume just 1 watt of power Kosst Amojan News 4 04-24-2010 09:42 PM
Bug: Can't add items to the library and existin items corrupted ckole enTourage Archive 11 04-16-2010 01:13 AM
Uploading queue el.astrologo Calibre 2 05-04-2009 04:45 AM


All times are GMT -4. The time now is 02:23 AM.


MobileRead.com is a privately owned, operated and funded community.