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

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

No class docstring
Method connectionMade Called when a connection is made.
Method connectionLost Called when the connection is shut down.
Method sendFlap send a FLAP to the client
Method dataReceived Called whenever data is received.
Method isFlap tests to see if a flap is actually on the buffer
Method readFlap read the first FLAP off self._buf, raising errors if it isn't in the right form. the FLAP is the basic TOC message format, and is logically equivilant to a packet in TCP
Method modeFlapon Undocumented
Method modeSignon Undocumented
Method modeTocSignon Undocumented
Method authorize Undocumented
Method modeConnected Undocumented
Method toc_unknown Undocumented
Method toc_init_done called when all the setup is done.
Method toc_add_permit adds users to the permit list. if the list is null, then set the mode to DENYALL
Method toc_add_deny adds users to the deny list. if the list is null, then set the mode to PERMITALL
Method toc_evil warns a user.
Method toc_add_buddy adds users to the buddy list
Method toc_remove_buddy removes users from the buddy list
Method toc_send_im incoming instant message
Method toc_set_info set the users information, retrivable with toc_get_info
Method toc_set_idle set/unset idle
Method toc_set_away set/unset away message
Method toc_chat_join joins the chat room.
Method toc_chat_invite invite others to the room.
Method toc_chat_accept accept an invitation.
Method toc_chat_send send a message to the chat room.
Method toc_chat_whisper Undocumented
Method toc_chat_leave leave the room.
Method toc_set_config set the saved config. this gets send when you log in.
Method toc_get_info get the user info for a user
Method toc_format_nickname change the format of your nickname.
Method toc_change_passwd Undocumented
Method sendError send an error to the user. listing of error messages is below.
Method updateUsers Update the users who have us on their buddylist. Called when the user changes anything (idle,away) so people can get updates.
Method getStatus Undocumented
Method canContact Undocumented
Method buddyUpdate Update the buddy. Called from updateUsers()
Method hearWhisper Called when you get an IM. If auto=1, it's an autoreply from an away message.
Method evilFrom Undocumented
Method chatJoin Undocumented
Method chatInvite Undocumented
Method chatUserUpdate Undocumented
Method chatMessage Undocumented
Method chatWhisper Undocumented
Method chatLeave Undocumented
Method _debug Undocumented

Inherited from BaseProtocol (via Protocol):

Method makeConnection Make a connection to a transport and a server.
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 _debug(self, data): (source)
Undocumented
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 sendFlap(self, type, data): (source)
send a FLAP to the client
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 isFlap(self): (source)
tests to see if a flap is actually on the buffer
def readFlap(self): (source)
read the first FLAP off self._buf, raising errors if it isn't in the right form. the FLAP is the basic TOC message format, and is logically equivilant to a packet in TCP
def modeFlapon(self): (source)
Undocumented
def modeSignon(self): (source)
Undocumented
def modeTocSignon(self): (source)
Undocumented
def authorize(self, server, port, username, password): (source)
Undocumented
def modeConnected(self): (source)
Undocumented
def toc_unknown(self, tocname, data): (source)
Undocumented
def toc_init_done(self, data): (source)

called when all the setup is done.

toc_init_done
def toc_add_permit(self, data): (source)
adds users to the permit list. if the list is null, then set the mode to DENYALL
def toc_add_deny(self, data): (source)
adds users to the deny list. if the list is null, then set the mode to PERMITALL
def toc_evil(self, data): (source)

warns a user.

toc_evil <username> <anon|norm>
def toc_add_buddy(self, data): (source)

adds users to the buddy list

toc_add_buddy <buddyname1> [<buddyname2>] [<buddyname3>]...
def toc_remove_buddy(self, data): (source)

removes users from the buddy list

toc_remove_buddy <buddyname1> [<buddyname2>] [<buddyname3>]...
def toc_send_im(self, data): (source)

incoming instant message

toc_send_im <screenname> <quoted message> [auto]
def toc_set_info(self, data): (source)

set the users information, retrivable with toc_get_info

toc_set_info <user info (quoted)>
def toc_set_idle(self, data): (source)

set/unset idle

toc_set_idle <seconds>
def toc_set_away(self, data): (source)

set/unset away message

toc_set_away [<away message>]
def toc_chat_join(self, data): (source)

joins the chat room.

toc_chat_join <exchange> <room name>
def toc_chat_invite(self, data): (source)

invite others to the room.

toc_chat_invite <room id> <invite message> <buddy 1> [<buddy2>]...
def toc_chat_accept(self, data): (source)

accept an invitation.

toc_chat_accept <room id>
def toc_chat_send(self, data): (source)

send a message to the chat room.

toc_chat_send <room id> <message>
def toc_chat_whisper(self, data): (source)
Undocumented
def toc_chat_leave(self, data): (source)

leave the room.

toc_chat_leave <room id>
def toc_set_config(self, data): (source)

set the saved config. this gets send when you log in.

toc_set_config <config>
def toc_get_info(self, data): (source)

get the user info for a user

toc_get_info <username>
def toc_format_nickname(self, data): (source)

change the format of your nickname.

toc_format_nickname <new format>
def toc_change_passwd(self, data): (source)
Undocumented
def sendError(self, code, *varargs): (source)
send an error to the user. listing of error messages is below.
def updateUsers(self): (source)
Update the users who have us on their buddylist. Called when the user changes anything (idle,away) so people can get updates.
def getStatus(self, user): (source)
Undocumented
def canContact(self, user): (source)
Undocumented
def buddyUpdate(self, user): (source)
Update the buddy. Called from updateUsers()
def hearWhisper(self, user, data, auto=0): (source)
Called when you get an IM. If auto=1, it's an autoreply from an away message.
def evilFrom(self, user): (source)
Undocumented
def chatJoin(self, room): (source)
Undocumented
def chatInvite(self, room, user, message): (source)
Undocumented
def chatUserUpdate(self, room, user): (source)
Undocumented
def chatMessage(self, room, user, message): (source)
Undocumented
def chatWhisper(self, room, user, message): (source)
Undocumented
def chatLeave(self, room): (source)
Undocumented
API Documentation for Twisted, generated by pydoctor at 2011-10-27 15:57:47.