Exemplo n.º 1
0
    def assertOutput(self, description, before, after):
        description = description.copy()
        description['output'] = {'type': 'test'}
        from echomesh.output.Registry import make_output

        output = make_output(description)
        output.emit_output(before)
        self.assertEqual(output.output[0].data, after)
Exemplo n.º 2
0
    def assertOutput(self, description, before, after):
        description = description.copy()
        description['output'] = {'type': 'test'}
        from echomesh.output.Registry import make_output

        output = make_output(description)
        output.emit_output(before)
        self.assertEqual(output.output[0].data, after)
Exemplo n.º 3
0
 def __init__(self, name, data, output_cache):
     self._name = name
     self._output_cache = output_cache
     if data:
         from echomesh.output.Registry import make_output
         self._output = make_output(data)
     else:
         self._output = default_output()
     self._output.start()
Exemplo n.º 4
0
 def __init__(self, name, data, output_cache):
     self._name = name
     self._output_cache = output_cache
     if data:
         from echomesh.output.Registry import make_output
         self._output = make_output(data)
     else:
         self._output = default_output()
     self._output.start()
Exemplo n.º 5
0
    def finish_construction(self, description, is_redirect=True):
        self.clients = []
        if is_redirect:
            output = description.pop('output', None)
            if output is None:
                raise Exception('No output in %s' % self.__class__.__name__)
            if not isinstance(output, (list, tuple)):
                output = [output]

            self.output = [make_output(o) for o in output]
            if False:  # TODO
                for o in self.output:
                    o.add_client(self)
        else:
            self.output = []

        if description:
            LOGGER.error('Unknown keywords %s in output %s', description,
                         self.__class__.__name__)
Exemplo n.º 6
0
 def _on_run(self):
     super(PatternElement, self)._on_run()
     if not self.output:
         self.output = make_output(self.output_data)
         self.output.add_client(self)
Exemplo n.º 7
0
 def _on_run(self):
     super(PatternElement, self)._on_run()
     if not self.output:
         self.output = make_output(self.output_data)
         self.output.add_client(self)