def find_task_handler(self, task): callback = task.get('callback') if callback: return callback else: try: handler = getattr(self, 'task_%s' % task.name) except AttributeError: raise NoTaskHandler('No handler or callback defined for task %s' % task.name) else: return handler
def find_task_handler(self, task): if task.origin_task_generator is not None: return self.handler_for_inline_task callback = task.get('callback') if callback: return callback else: try: handler = getattr(self, 'task_%s' % task.name) except AttributeError: raise NoTaskHandler('No handler or callback defined for ' 'task %s' % task.name) else: return handler