AIM HarnessProvides a high-level Kamaelia interface to AIM. For a Kamaelia interface at the FLAP and SNAC levels, see OSCARClient.py Example UsageA 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() How it worksAIMHarness 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":
Known issuesThis component does not terminate. Kamaelia.Protocol.AIM.AIMHarness.AIMHarnessclass AIMHarness(Axon.Component.component)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. Inboxes
Outboxes
Methods defined hereWarning! 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. __init__(self, screenname, password)x.__init__(...) initializes x; see x.__class__.__doc__ for signature main(self)Waits for logged-in OSCARClient and links it up to ChatManager FeedbackGot 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 |
Kamaelia
is an open source project originated from and guided by BBC
Research. For more information browse the site or get in
contact.
This is an ongoing community based development site. As a result the contents of this page is the opinions of the contributors of the pages involved not the organisations involved. Specificially, this page may contain personal views which are not the views of the BBC. (the site is powered by a wiki engine)
(C) Copyright 2008 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved.