from Axon.Component import component
from Axon.Ipc import producerFinished, shutdownMicroprocess, shutdown

class DataSource(component):
    def __init__(self, messages):
        super(DataSource, self).__init__()
        self.messages = messages
        
    def main(self):
        while len(self.messages) > 0:
            yield 1
            self.send(self.messages.pop(0), "outbox")
        self.send(producerFinished(), "signal")

@@ -381,16 +381,32 @@
 utbox%22)%0A
+        yield 1%0A
         
@@ -445,8 +445,337 @@
 ignal%22)%0A
+        return%0A%0Aif __name__ == %22__main__%22:%0A    from Kamaelia.Util.PipelineComponent import pipeline%0A    from Kamaelia.Util.Console import ConsoleReader, ConsoleEchoer%0A%0A    pipeline(%0A        DataSource( %5B%22hello%22, %22 %22, %22there%22, %22 %22, %22how%22, %22 %22, %22are%22, %22 %22, %22you%22, %22 %22, %22today%5Cr%5Cn%22, %22?%22, %22!%22%5D ),%0A        ConsoleEchoer()%0A    ).run()%0A

Work around a minor bug in ConsoleEchoer - yield before sending a complete message.