def _call_fini(self, *options, **kwds): for key in self._retval: if not key in self.outputs: raise RuntimeError("Cannot return value '%s' that is not a predefined output of a Functor task" % key) setattr(self, key, self._retval[key]) TaskPlugin._call_fini(self, *options, **kwds) return self._retval
def _call_fini(self, *options, **kwds): for key in self._retval: if not key in self.outputs: raise RuntimeError( "Cannot return value '%s' that is not a predefined output of a Functor task" % key) setattr(self, key, self._retval[key]) TaskPlugin._call_fini(self, *options, **kwds) return self._retval
def _call_init(self, *options, **kwds): if not 'data' in kwds: if len(options) > 0: if len(options) > 1: raise RuntimeError("A FunctorTask instance can only be executed with a single non-keyword argument") kwds['data'] = options[0] #options = options[1:] elif not self.inputs.data.optional: raise RuntimeError("A FunctorTask instance must be executed with at 'data' argument") self._kwds = kwds return TaskPlugin._call_init(self, **kwds)
def _call_init(self, *options, **kwds): if not 'data' in kwds: if len(options) > 0: if len(options) > 1: raise RuntimeError( "A FunctorTask instance can only be executed with a single non-keyword argument" ) kwds['data'] = options[0] #options = options[1:] elif not self.inputs.data.optional: raise RuntimeError( "A FunctorTask instance must be executed with at 'data' argument" ) self._kwds = kwds return TaskPlugin._call_init(self, **kwds)
def __init__(self, *args, **kwargs): self._fn = kwargs.pop('fn', None) # TaskPlugin.__init__(self, *args, **kwargs)