Package flumotion :: Package twisted :: Module pb :: Class Avatar
[hide private]

Class Avatar

source code

twisted.spread.pb.Avatar --+
                           |
     common.log.Loggable --+
                           |
                          Avatar
Known Subclasses:

Instance Methods [hide private]
 
__init__(self, avatarId) source code
 
perspectiveMessageReceived(self, broker, message, args, kwargs)
This method is called when a network message is received.
source code
 
setMind(self, mind)
Tell the avatar that the given mind has been attached.
source code
 
mindCallRemoteLogging(self, level, stackDepth, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
source code
 
mindCallRemote(self, name, *args, **kwargs)
Call the given remote method, and log calling and returning nicely.
source code
 
disconnect(self)
Disconnect the remote PB client.
source code

Inherited from twisted.spread.pb.Avatar: __providedBy__

Inherited from common.log.Loggable: debug, doLog, error, info, log, logFunction, logObjectName, warning, warningFailure

Class Variables [hide private]
  logCategory = 'avatar'
Implementors can provide a category to log their messages under.
str remoteLogName = 'remote'
name to use to log the other side of the connection

Inherited from twisted.spread.pb.Avatar: __implemented__, __provides__

Method Details [hide private]

perspectiveMessageReceived(self, broker, message, args, kwargs)

source code 

This method is called when a network message is received.

I will call:

 |  self.perspective_%(message)s(*broker.unserialize(args),
 |                               **broker.unserialize(kw))

to handle the method; subclasses of Avatar are expected to implement methods of this naming convention.

Overrides: twisted.spread.pb.Avatar.perspectiveMessageReceived
(inherited documentation)

setMind(self, mind)

source code 

Tell the avatar that the given mind has been attached. This gives the avatar a way to call remotely to the client that requested this avatar. This is scheduled by the portal after the client has logged in.

Parameters:
  • mind (twisted.spread.pb.RemoteReference)

mindCallRemoteLogging(self, level, stackDepth, name, *args, **kwargs)

source code 

Call the given remote method, and log calling and returning nicely.

Parameters:
  • level (int) - the level we should log at (log.DEBUG, log.INFO, etc)
  • stackDepth (non-positive int) - the number of stack frames to go back to get file and line information, negative or zero.
  • name (str) - name of the remote method

mindCallRemote(self, name, *args, **kwargs)

source code 

Call the given remote method, and log calling and returning nicely.

Parameters:
  • name (str) - name of the remote method

disconnect(self)

source code 

Disconnect the remote PB client. If we are already disconnected, do nothing.