@JimmXinu - I've uploaded a new version of the zip with the self parameter on the previous post.
As for the background stuff, it depends on how you do it. Basically it depends on whether you want to do it in-process (faster execution for small jobs) or out of process (the latter being a "job" the gets put in the calibre jobs queue, like downloading metadata or send to device).
Count Pages (& Modify ePub) use the job queue (out of process) approach, which is the most common way of doing it. Effectively it is scheduling an executable process to be launched for each "job". This has the additional advantage that if the code being called has memory leaks (which anything related to book conversions does for instance) you are not going to crash the main calibre process.
Extract ISBN has both the in-process and out of process approaches. If the user selects a very small number of books (can't remember the threshold I put in, might may be something like 2 or less), then it uses the in-process approach. More than that, it uses out of process (for memory leak prevention reasons).
|