View Single Post
Old 06-07-2021, 07:37 AM   #587
capink
Wizard
capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.capink ought to be getting tired of karma fortunes by now.
 
Posts: 1,203
Karma: 1995558
Join Date: Aug 2015
Device: Kindle
Another job as in calibre job? Or do you mean another chain or event? If you mean calibre job, you can try the following template function (copy past into module editor):

Code:
from calibre_plugins.action_chains.templates import TemplateFunction

class IsJobsRunning(TemplateFunction):

    name = 'is_jobs_running'
    arg_count = 0

    def evaluate(self, formatter, kwargs, mi, locals):
        gui = self.plugin_action.gui
        jobs = [job.id for job in gui.job_manager.unfinished_jobs()]
        if jobs:
            return 1
        else:
            return ''

Last edited by capink; 06-07-2021 at 09:33 AM. Reason: Add missing import
capink is offline   Reply With Quote