August'24: Kamaelia is in maintenance mode and will recieve periodic updates, about twice a year, primarily targeted around Python 3 and ecosystem compatibility. PRs are always welcome. Latest Release: 1.14.32 (2024/3/24)
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(). Similarly if a "tag" is provided it's prepended before the data.
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][,tag]) -> new ConsoleEchoer component.
A component that outputs anything it is sent to standard output (the console).
Keyword arguments:
Warning!
You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.
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:
Warning!
You should be using the inbox/outbox interface, not these methods (except construction). This documentation is designed as a roadmap as to their functionalilty for maintainers and new component developers.
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, 05 Jun 2009 at 03:01:38 UTC/GMT