The ConsoleEchoer component outputs whatever it receives to the console.
The ConsoleReader component outputs whatever is typed at the console, a line at a time.
Whatever it typed is echoed back, a line at a time:
Pipeline( ConsoleReader(), ConsoleEchoer() ).run()
ConsoleReader is a threaded component. It provides a 'prompt' at which you can type. Your input is taken, a line a a time, and output to its "outbox" outbox, with the specified end-of-line character(s) suffixed onto it.
The ConsoleReader component ignores any input on its "inbox" and "control" inboxes. It does not output anything from its "signal" outbox.
The ConsoleReader component does not terminate.
The ConsoleEchoer component receives data on its "inbox" inbox. Anything it receives this way is displayed on standard output. All items are passed through the str() builtin function to convert them to strings suitable for display.
However, if the 'use_repr' argument is set to True during initialization, then repr() will be used instead of str().
If the 'forwarder' argument is set to True during initialisation, then whatever is received is not only displayed, but also set on to the "outbox" outbox (unchanged).
If a producerFinished or shutdownMicroprocess message is received on the ConsoleEchoer component's "control" inbox, then it is sent on to the "signal" outbox and the component then terminates.
ConsoleEchoer([forwarder][,use_repr]) -> new ConsoleEchoer component.
A component that outputs anything it is sent to standard output (the console).
Keyword arguments:
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Main loop body.
ConsoleReader([prompt][,eol]) -> new ConsoleReader component.
Component that provides a console for typing in stuff. Each line is output from the "outbox" outbox one at a time.
Keyword arguments:
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Main thread loop.
Got a problem with the documentation? Something unclear that could be clearer? Want to help improve it? Constructive criticism is very welcome - especially if you can suggest a better rewording!
Please leave you feedback here in reply to the documentation thread in the Kamaelia blog.
-- Automatic documentation generator, 19 Oct 2008 at 14:29:09 UTC/GMT