Ejemplo n.º 1
0
 def run(self, format_type, message, *params):
     if format_type == 'dict':
         return message % params[0]
     elif format_type == 'tuple':
         return message % params
     else:
         raise pipeline.Abort('Invalid format type: %s' % format_type)
Ejemplo n.º 2
0
 def run(self, *args, **kwargs):
     self._LogStatusPath()
     arg = _ConvertPipelineParametersToInputObject(self.input_type, args,
                                                   kwargs)
     result = self._RunImplWrapper(arg)
     if not isinstance(result, self.output_type):
         raise pipeline.Abort(
             'Expected output of type %s, but got %s' %
             (self.output_type.__name__, type(result).__name__))
     return _ConvertToPipelineOutput(result)
Ejemplo n.º 3
0
 def run(self, *args, **kwargs):
     self._LogStatusPath()
     arg = _ConvertPipelineParametersToInputObject(self.input_type, args,
                                                   kwargs)
     pipeline_iter = self._RunImplWrapper(arg)
     if pipeline_iter and not isinstance(pipeline_iter,
                                         types.GeneratorType):
         raise pipeline.Abort('%s did not spawn other pipelines' %
                              self.__class__.__name__)
     next_future = None
     while pipeline_iter:
         try:
             sub_pipeline = pipeline_iter.send(next_future)
             next_future = yield sub_pipeline
         except StopIteration:
             break
Ejemplo n.º 4
0
 def run(self, value, message=''):
     if value:
         raise pipeline.Abort(message)