t.w.p.t.TOCClient(protocol.Protocol) : class documentation

Part of twisted.words.protocols.toc View Source View In Hierarchy

Known subclasses: twisted.words.im.tocsupport.TOCProto

No class docstring
Method __init__ Undocumented
Method sendFlap Undocumented
Method isFlap tests to see if a flap is actually on the buffer
Method readFlap Undocumented
Method connectionMade Called when a connection is made.
Method connectionLost Called when the connection is shut down.
Method dataReceived Called whenever data is received.
Method modeSendNick Undocumented
Method modeData Undocumented
Method tocUNKNOWN Undocumented
Method tocSIGN_ON Undocumented
Method tocNICK Handle a message that looks like:

Method tocCONFIG Handle a message that looks like:

Method tocIM_IN Handle a message that looks like:

Method tocUPDATE_BUDDY Handle a message that looks like:

Method tocERROR Handle a message that looks like:

Method tocEVILED Handle a message that looks like:

Method tocCHAT_JOIN Handle a message that looks like:

Method tocCHAT_UPDATE_BUDDY Handle a message that looks like:

Method tocCHAT_IN Handle a message that looks like:

Method tocCHAT_INVITE Handle a message that looks like:

Method tocCHAT_LEFT Handle a message that looks like:

Method tocRVOUS_PROPOSE Handle a message that looks like:

Method tocSEND_FILE Undocumented
Method tocGET_FILE Undocumented
Method onLine called when we are first online
Method gotConfig No summary
Method hearError called when an error is received code := error code args := misc. arguments (username, etc.)
Method hearWarning called when we get warned newamount := the current warning level username := the user who warned us, or '' if it's anonymous
Method hearMessage No summary
Method updateBuddy No summary
Method chatJoined No summary
Method chatUpdate No summary
Method chatHearMessage No summary
Method chatHearWhisper No summary
Method chatInvited No summary
Method chatLeft we left the room roomid := the AIM id for the room
Method rvousProposal No summary
Method receiveBytes No summary
Method isaway return our away status
Method set_config No summary
Method add_buddy Undocumented
Method del_buddy Undocumented
Method add_permit Undocumented
Method del_permit Undocumented
Method add_deny Undocumented
Method del_deny Undocumented
Method signon called to finish the setup, and signon to the network
Method say No summary
Method idle change idle state idletime := the seconds that the user has been away, or 0 if they're back
Method evil warn a user user := the user to warn anon := if true, an anonymous warning
Method away change away state message := the message, or '' to come back from awayness
Method chat_join join a chat room exchange := should almost always be 4 roomname := room name
Method chat_say send a message to a chatroom roomid := the AIM id for the room message := the message to send
Method chat_whisper No summary
Method chat_leave leave a chat room. roomid := the AIM id for the room
Method chat_invite No summary
Method chat_accept accept an invite to a chat room roomid := the AIM id for the room
Method rvous_accept Undocumented
Method rvous_cancel Undocumented
Method _debug Undocumented

Inherited from BaseProtocol (via Protocol):

Method makeConnection Make a connection to a transport and a server.
def __init__(self, username, password, authhost='login.oscar.aol.com', authport=5190): (source)
Undocumented
def _debug(self, data): (source)
Undocumented
def sendFlap(self, type, data): (source)
Undocumented
def isFlap(self): (source)
tests to see if a flap is actually on the buffer
def readFlap(self): (source)
Undocumented
def connectionMade(self): (source)

Called when a connection is made.

This may be considered the initializer of the protocol, because it is called when the connection is completed. For clients, this is called once the connection to the server has been established; for servers, this is called after an accept() call stops blocking and a socket has been received. If you need to send any greeting or initial message, do it here.
def connectionLost(self, reason): (source)

Called when the connection is shut down.

Clear any circular references here, and any external references to this Protocol. The connection has been closed.
Parametersreason (type: twisted.python.failure.Failure )
def dataReceived(self, data): (source)

Called whenever data is received.

Use this method to translate to a higher-level message. Usually, some callback will be made upon the receipt of each complete protocol message.
Parametersdataa string of indeterminate length. Please keep in mind that you will probably need to buffer some data, as partial (or multiple) protocol messages may be received! I recommend that unit tests for protocols call through to this method with differing chunk sizes, down to one byte at a time.
def modeSendNick(self, flap): (source)
Undocumented
def modeData(self, flap): (source)
Undocumented
def tocUNKNOWN(self, command, data): (source)
Undocumented
def tocSIGN_ON(self, data): (source)
Undocumented
def tocNICK(self, data): (source)
Handle a message that looks like:
   NICK:<format of nickname>
def tocCONFIG(self, data): (source)
Handle a message that looks like:
   CONFIG:<config>
Format of config data:
  • g: group. all users until next g or end of config are in this group
  • b: buddy
  • p: person on the permit list
  • d: person on the deny list
  • m: permit/deny mode (1: permit all, 2: deny all, 3: permit some, 4: deny some)
def tocIM_IN(self, data): (source)
Handle a message that looks like:
   IM_IN:<user>:<autoreply T|F>:message
def tocUPDATE_BUDDY(self, data): (source)
Handle a message that looks like:
   UPDATE_BUDDY:<username>:<online T|F>:<warning level>:<signon time>:<idle time (minutes)>:<user class>
def tocERROR(self, data): (source)
Handle a message that looks like:
   ERROR:<error code>:<misc. data>
def tocEVILED(self, data): (source)
Handle a message that looks like:
   EVILED:<current warning level>:<user who warned us>
def tocCHAT_JOIN(self, data): (source)
Handle a message that looks like:
   CHAT_JOIN:<room id>:<room name>
def tocCHAT_UPDATE_BUDDY(self, data): (source)
Handle a message that looks like:
   CHAT_UPDATE_BUDDY:<room id>:<in room? T/F>:<user 1>:<user 2>...
def tocCHAT_IN(self, data): (source)
Handle a message that looks like:
   CHAT_IN:<room id>:<username>:<whisper T/F>:<message>
whisper isn't used
def tocCHAT_INVITE(self, data): (source)
Handle a message that looks like:
   CHAT_INVITE:<room name>:<room id>:<username>:<message>
def tocCHAT_LEFT(self, data): (source)
Handle a message that looks like:
   CHAT_LEFT:<room id>
def tocRVOUS_PROPOSE(self, data): (source)
Handle a message that looks like:
   RVOUS_PROPOSE:<user>:<uuid>:<cookie>:<seq>:<rip>:<pip>:<vip>:<port>
         [:tlv tag1:tlv value1[:tlv tag2:tlv value2[:...]]]
def tocSEND_FILE(self, user, cookie, seq, pip, vip, port, tlvs): (source)
Undocumented
def tocGET_FILE(self, user, cookie, seq, pip, vip, port, tlvs): (source)
Undocumented
def onLine(self): (source)
called when we are first online
def gotConfig(self, mode, buddylist, permit, deny): (source)
called when we get a configuration from the server mode := permit/deny mode buddylist := current buddylist permit := permit list deny := deny list
def hearError(self, code, args): (source)
called when an error is received code := error code args := misc. arguments (username, etc.)
def hearWarning(self, newamount, username): (source)
called when we get warned newamount := the current warning level username := the user who warned us, or '' if it's anonymous
def hearMessage(self, username, message, autoreply): (source)
called when you receive an IM username := the user who the IM is from message := the message autoreply := true if the message is an autoreply from an away message
def updateBuddy(self, username, online, evilness, signontime, idletime, userclass, away): (source)
called when a buddy changes state username := the user whos state changed online := true if the user is online evilness := the users current warning level signontime := the time the user signed on (UNIX epoch) idletime := the time the user has been idle (minutes) away := true if the user is away userclass := the class of the user (generally " O")
def chatJoined(self, roomid, roomname, users): (source)
we just joined a chat room roomid := the AIM id for the room roomname := the name for the room users := a list of the users already in the room
def chatUpdate(self, roomid, username, inroom): (source)
a user has joined the room roomid := the AIM id for the room username := the username inroom := true if the user is in the room
def chatHearMessage(self, roomid, username, message): (source)
a message was sent to the room roomid := the AIM id for the room username := the user who sent the message message := the message
def chatHearWhisper(self, roomid, username, message): (source)
someone whispered to us in a chatroom roomid := the AIM for the room username := the user who whispered to us message := the message
def chatInvited(self, roomid, roomname, username, message): (source)
we were invited to a chat room roomid := the AIM id for the room roomname := the name of the room username := the user who invited us message := the invite message
def chatLeft(self, roomid): (source)
we left the room roomid := the AIM id for the room
def rvousProposal(self, type, cookie, user, vip, port, **kw): (source)
we were asked for a rondevouz type := the type of rondevous. currently, one of ["send"] cookie := the cookie. pass this to rvous_accept() user := the user who asked us vip := their verified_ip port := the port they want us to conenct to kw := misc. args
def receiveBytes(self, user, file, chunk, sofar, total): (source)
we received part of a file from a file transfer file := the name of the file chunk := the chunk of data sofar := how much data we've gotten so far total := the total amount of data
def isaway(self): (source)
return our away status
def set_config(self, mode, buddylist, permit, deny): (source)
set the server configuration mode := permit mode buddylist := buddy list permit := permit list deny := deny list
def add_buddy(self, buddies): (source)
Undocumented
def del_buddy(self, buddies): (source)
Undocumented
def add_permit(self, users): (source)
Undocumented
def del_permit(self, users): (source)
Undocumented
def add_deny(self, users): (source)
Undocumented
def del_deny(self, users): (source)
Undocumented
def signon(self): (source)
called to finish the setup, and signon to the network
def say(self, user, message, autoreply=0): (source)
send a message user := the user to send to message := the message autoreply := true if the message is an autoreply (good for away messages)
def idle(self, idletime=0): (source)
change idle state idletime := the seconds that the user has been away, or 0 if they're back
def evil(self, user, anon=0): (source)
warn a user user := the user to warn anon := if true, an anonymous warning
def away(self, message=''): (source)
change away state message := the message, or '' to come back from awayness
def chat_join(self, exchange, roomname): (source)
join a chat room exchange := should almost always be 4 roomname := room name
def chat_say(self, roomid, message): (source)
send a message to a chatroom roomid := the AIM id for the room message := the message to send
def chat_whisper(self, roomid, user, message): (source)
whisper to another user in a chatroom roomid := the AIM id for the room user := the user to whisper to message := the message to send
def chat_leave(self, roomid): (source)
leave a chat room. roomid := the AIM id for the room
def chat_invite(self, roomid, usernames, message): (source)
invite a user[s] to the chat room roomid := the AIM id for the room usernames := either a string (one username) or a list (more than one) message := the message to invite them with
def chat_accept(self, roomid): (source)
accept an invite to a chat room roomid := the AIM id for the room
def rvous_accept(self, cookie): (source)
Undocumented
def rvous_cancel(self, cookie): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:17:34.