Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`words`.`service`.`WordsRealm``

class documentation

`class 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
Method | `addGroup` | Add the given group to this service.
Method | `addUser` | Add the given user to this service.
Method | `createGroup` | Create a new group with the given name.
Method | `createUser` | Create a new user with the given name.
Method | `getGroup` | Retrieve the group by the given name.
Method | `getUser` | Retrieve the user by the given name.
Method | `groupFactory` | Undocumented
Method | `itergroups` | Return all groups available on this service.
Method | `logoutFactory` | Undocumented
Method | `lookupGroup` | Retrieve a group by name.
Method | `lookupUser` | Undocumented
Method | `requestAvatar` | Return avatar which provides one of the given interfaces.
Method | `userFactory` | Undocumented
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.
Instance Variable | `name` | A short string identifying this chat service (eg, a hostname)
Class Variable | `_encoding` | Undocumented

def __init__(self, name): (source)
overridden in `twisted.words.service.InMemoryWordsRealm`

Undocumented

def addGroup(self, group): (source)
overridden in `twisted.words.service.InMemoryWordsRealm`

Add the given group to this service.

Parameters
group:`IGroup` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A 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.

def addUser(self, user): (source)
overridden in `twisted.words.service.InMemoryWordsRealm`

Add the given user to this service.

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

Parameters
user:`IUser` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A 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.

def createGroup(self, name): (source)
from `twisted.words.iwords.IChatService`

Create a new group with the given name.

Parameters
name:`str` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A Deferred which fires with the created group, or with fails with `twisted.words.ewords.DuplicateGroup` if a group by that name exists already.

def createUser(self, name): (source)
from `twisted.words.iwords.IChatService`

Create a new user with the given name.

Parameters
name:`str` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A Deferred which fires with the created user, or with fails with `twisted.words.ewords.DuplicateUser` if a user by that name exists already.

def getGroup(self, name): (source)
from `twisted.words.iwords.IChatService`

Retrieve the group by the given name.

Parameters
name:`str` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A 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.

def getUser(self, name): (source)
from `twisted.words.iwords.IChatService`

Retrieve the user by the given name.

Parameters
name:`str` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A 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.

def groupFactory(self, name): (source)

Undocumented

def itergroups(self): (source)
from `twisted.words.iwords.IChatService`
overridden in `twisted.words.service.InMemoryWordsRealm`

Return all groups available on this service.

Returns
`twisted.internet.defer.Deferred` | A Deferred which fires with a list of `IGroup` providers.

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

Undocumented

def lookupGroup(self, group): (source)
from `twisted.words.iwords.IChatService`
overridden in `twisted.words.service.InMemoryWordsRealm`

Retrieve a group by name.

Unlike `getGroup`, this will never implicitly create a group.

Parameters
group | Undocumented
name:`str` | Undocumented
Returns
`twisted.internet.defer.Deferred` | A Deferred which fires with the group by the given name, or which fails with `twisted.words.ewords.NoSuchGroup`.

def lookupUser(self, name): (source)
overridden in `twisted.words.service.InMemoryWordsRealm`

Undocumented

def requestAvatar(self, avatarId, mind, *interfaces): (source)
from `twisted.cred.portal.IRealm`

Return avatar which provides one of the given interfaces.

Parameters
avatarId | a string that identifies an avatar, as returned by `ICredentialsChecker.requestAvatarId` (via a Deferred). Alternatively, it may be `twisted.cred.checkers.ANONYMOUS`.
mind | usually None. See the description of mind in `Portal.login`.
*interfaces | the interface(s) the returned avatar should implement, e.g. `IMailAccount`. See the description of `Portal.login`.
Returns
a 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 userFactory(self, name): (source)

Undocumented

createGroupOnRequest: `bool` = (source)
from `twisted.words.iwords.IChatService`

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

createUserOnRequest: `bool` = (source)
from `twisted.words.iwords.IChatService`

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

name = (source)
from `twisted.words.iwords.IChatService`

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

_encoding: `str` = (source)

Undocumented