Kamaelia docs : Kamaelia.Protocol.AIM.AIMHarness

AIM Harness

Provides a high-level Kamaelia interface to AIM.

For a Kamaelia interface at the FLAP and SNAC levels, see OSCARClient.py

Example Usage

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()

How it works

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

Known issues

This component does not terminate.


Kamaelia.Protocol.AIM.AIMHarness.AIMHarness

class 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

  • control : NOT USED
  • internal control : links to signal outbox of various child components
  • inbox : tuple-based commands for ChatManager
  • internal inbox : links to various child components

Outboxes

  • outbox : tuple-based notifications from ChatManager
  • signal : NOT USED
  • internal signal : sends shutdown handling signals to various child components
  • internal outbox : outbox to various child components

Methods defined here

__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

Feedback

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

This is a page from the Kamaelia website. You can find the original here: