KamaeliaNuts & Bolts | Components | Tools | Cookbook | Systems
wiki:( guest738206, Dev Console, Index, Recent, Edit )
NOTIFICATION EVENT
("buddy online", {buddy information}) A buddy comes online
("message", sender, message text) An instant message arrives for you
("error", error message) An error occurs during the first stage of login
def sendTo(recipient, text):
return ("message", recipient, text)
def outformat(data, buddyname):
if data[0] == "buddy online" and data[1]["name"] == buddyname:
return "%s is online" % buddyname
elif data[0] == "message" and data[1] == buddyname:
return "%s: %s" % (buddyname, data[2])
elif data[0] == "error":
": ".join(data)
def SimpleAIMClient(screenname, password, buddyname):
Pipeline(Textbox(position=(0, 400)),
PureTransformer(lambda text: sendTo(buddyname, text)),
AIMHarness(screenname, password),
PureTransformer(lambda tup: outformat(tup, buddyname)),
TextDisplayer()
).run()
Versions: current , 1 , 2 , 3 , 4 , 5
(C) 2005 Kamaelia Contributors, including the British Broadcasting Corporation, All Rights Reserved,
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.