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`.`python`.`fakepwd`.`UserDatabase``

class documentation

`class UserDatabase: (source)`

View In Hierarchy

`UserDatabase` holds a traditional POSIX user data in memory and makes it available via the same API as `pwd`.

Method | `__init__` | Undocumented
Method | `addUser` | Add a new user record to this database.
Method | `getpwall` | Return a list of all user records.
Method | `getpwnam` | Return the user record corresponding to the given username.
Method | `getpwuid` | Return the user record corresponding to the given uid.
Instance Variable | `_users` | A `list` of `_UserRecord` instances holding all user data added to this database.

def __init__(self): (source)

Undocumented

def addUser(self, username, password, uid, gid, gecos, home, shell): (source)

Add a new user record to this database.

Parameters
username:`str` | The value for the `pw_name` field of the user record to add.
password:`str` | The value for the `pw_passwd` field of the user record to add.
uid:`int` | The value for the `pw_uid` field of the user record to add.
gid:`int` | The value for the `pw_gid` field of the user record to add.
gecos:`str` | The value for the `pw_gecos` field of the user record to add.
home:`str` | The value for the `pw_dir` field of the user record to add.
shell:`str` | The value for the `pw_shell` field of the user record to add.

def getpwall(self): (source)

Return a list of all user records.

Returns
`List[_UserRecord]` | Undocumented

def getpwnam(self, name): (source)

Return the user record corresponding to the given username.

Parameters
name:`str` | Undocumented
Returns
`_UserRecord` | Undocumented

def getpwuid(self, uid): (source)

Return the user record corresponding to the given uid.

Parameters
uid:`int` | Undocumented
Returns
`_UserRecord` | Undocumented

_users: `list` = (source)

A `list` of `_UserRecord` instances holding all user data added to this database.