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)
Provides a high-level Kamaelia interface to AIM.
For a Kamaelia interface at the FLAP and SNAC levels, see OSCARClient.py
A simple command-line client with a truly horrible interface:
def tuplefy(data):
data = data.split()
if len(data) > 1:
data = ("message", data[0], " ".join(data[1:]))
return data
Pipeline(ConsoleReader(),
PureTransformer(tuplefy),
AIMHarness(),
ConsoleEchoer()
).run()
AIMHarness ties LoginHandler and ChatManager together. First it initializes a LoginHandler, waits for it to send out a logged-in OSCARClient, then wires up a ChatManager to the OSCARClient. It wires up its "inbox" to ChatManager's "talk", and ChatManager's "heard" to "outbox".
Once everything is up and functioning, the AIMHarness will stay running to act as an intermediary to pass messages between the OSCARClient and the ChatManager, but the AIMHarness will not act upon any of the information other than to pass it.
To send an instant message to another user, send the command ("message", recipient, text of the message) to its "inbox".
AIMHarness will send out the following notifications through its "outbox":
NOTIFICATION | EVENT |
---|---|
("buddy online", {buddy information}) | A buddy comes online |
("message", sender, message text) | An instant message arrives for you |
This component does not terminate.
AIMHarness() -> new AIMHarness component
Send ("message", recipient, message) commands to its "inbox" to send instant messages. It will output ("buddy online", {name: buddyname}) and ("message", sender, message) tuples whenever a buddy comes online or a new message arrives for you.
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
Waits for logged-in OSCARClient and links it up to ChatManager
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