class documentation

class twisted.words.service.WordsRealm: (source)

Known subclasses: twisted.words.service.InMemoryWordsRealm

Implements interfaces: twisted.cred.portal.IRealm, twisted.words.iwords.IChatService

View In Hierarchy

Undocumented

Method __init__ Undocumented
Instance Variable name A short string identifying this chat service (eg, a hostname)
Method userFactory Undocumented
Method groupFactory Undocumented
Method logoutFactory Undocumented
Method requestAvatar Return avatar which provides one of the given interfaces.
Method itergroups Return all groups available on this service.
Class Variable createGroupOnRequest A boolean indicating whether getGroup should implicitly create groups which are requested but which do not yet exist.
Class Variable createUserOnRequest A boolean indicating whether getUser should implicitly create users which are requested but which do not yet exist.
Method lookupUser Undocumented
Method lookupGroup Retrieve a group by name.
Method addUser Add the given user to this service.
Method addGroup Add the given group to this service.
Method getGroup Retrieve the group by the given name.
Method getUser Retrieve the user by the given name.
Method createUser Create a new user with the given name.
Method createGroup Create a new group with the given name.
Class Variable _encoding Undocumented
_encoding = (source)

Undocumented

(type: str)
def __init__(self, name): (source)

Undocumented

name = (source)

A short string identifying this chat service (eg, a hostname)

def userFactory(self, name): (source)

Undocumented

def groupFactory(self, name): (source)

Undocumented

def logoutFactory(self, avatar, facet): (source)

Undocumented

def requestAvatar(self, avatarId, mind, *interfaces): (source)

Return avatar which provides one of the given interfaces.

ParametersavatarIda string that identifies an avatar, as returned by ICredentialsChecker.requestAvatarId (via a Deferred). Alternatively, it may be twisted.cred.checkers.ANONYMOUS.
mindusually None. See the description of mind in Portal.login.
interfacesthe interface(s) the returned avatar should implement, e.g. IMailAccount. See the description of Portal.login.
Returnsa deferred which will fire a tuple of (interface, avatarAspect, logout), or the tuple itself. The interface will be one of the interfaces passed in the 'interfaces' argument. The 'avatarAspect' will implement that interface. The 'logout' object is a callable which will detach the mind from the avatar.
def itergroups(self): (source)

Return all groups available on this service.

ReturnsA Deferred which fires with a list of IGroup providers. (type: twisted.internet.defer.Deferred)
createGroupOnRequest = (source)

A boolean indicating whether getGroup should implicitly create groups which are requested but which do not yet exist.

(type: bool)
createUserOnRequest = (source)

A boolean indicating whether getUser should implicitly create users which are requested but which do not yet exist.

(type: bool)
def lookupUser(self, name): (source)

Undocumented

def lookupGroup(self, group): (source)

Retrieve a group by name.

Unlike getGroup, this will never implicitly create a group.

ParametersgroupUndocumented
nameUndocumented (type: str)
ReturnsA Deferred which fires with the group by the given name, or which fails with twisted.words.ewords.NoSuchGroup. (type: twisted.internet.defer.Deferred)
def addUser(self, user): (source)

Add the given user to this service.

This is an internal method intended to be overridden by WordsRealm subclasses, not called by external code.

ParametersuserUndocumented (type: IUser)
ReturnsA Deferred which fires with None when the user is added, or which fails with twisted.words.ewords.DuplicateUser if a user with the same name exists already. (type: twisted.internet.defer.Deferred)
def addGroup(self, group): (source)

Add the given group to this service.

ParametersgroupUndocumented (type: IGroup)
ReturnsA Deferred which fires with None when the group is added, or which fails with twisted.words.ewords.DuplicateGroup if a group with the same name exists already. (type: twisted.internet.defer.Deferred)
def getGroup(self, name): (source)

Retrieve the group by the given name.

ParametersnameUndocumented (type: str)
ReturnsA Deferred which fires with the group with the given name if one exists (or if one is created due to the setting of IChatService.createGroupOnRequest, or which fails with twisted.words.ewords.NoSuchGroup if no such group exists. (type: twisted.internet.defer.Deferred)
def getUser(self, name): (source)

Retrieve the user by the given name.

ParametersnameUndocumented (type: str)
ReturnsA Deferred which fires with the user with the given name if one exists (or if one is created due to the setting of IChatService.createUserOnRequest, or which fails with twisted.words.ewords.NoSuchUser if no such user exists. (type: twisted.internet.defer.Deferred)
def createUser(self, name): (source)

Create a new user with the given name.

ParametersnameUndocumented (type: str)
ReturnsA Deferred which fires with the created user, or with fails with twisted.words.ewords.DuplicateUser if a user by that name exists already. (type: twisted.internet.defer.Deferred)
def createGroup(self, name): (source)

Create a new group with the given name.

ParametersnameUndocumented (type: str)
ReturnsA Deferred which fires with the created group, or with fails with twisted.words.ewords.DuplicateGroup if a group by that name exists already. (type: twisted.internet.defer.Deferred)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.