def pre_run(task): if not ALLOW_TASKS: raise CancelExecution()
def pre_execute_cancel(task): if not allow_tasks[0]: raise CancelExecution()
def cancel_all_tasks(task): raise CancelExecution()