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`.`names`.`hosts``

module documentation
(source)

hosts(5) support.

Class | `Resolver` | A resolver that services hosts(5) format files.
Function | `searchFileFor` | Grep given file, which is in hosts(5) standard format, for an address entry with a given name.
Function | `searchFileForAll` | Search the given file, which is in hosts(5) standard format, for addresses associated with a given name.

def searchFileFor(file, name): (source)

Grep given file, which is in hosts(5) standard format, for an address entry with a given name.

Parameters
file:`str` or `bytes` | The name of the hosts(5)-format file to search.
name:`bytes` | The name to search for.
Returns
`None` if the name is not found in the file, otherwise a `str` giving the first address in the file associated with the name.

def searchFileForAll(hostsFile, name): (source)

Search the given file, which is in hosts(5) standard format, for addresses associated with a given name.

Parameters
hostsFile:`FilePath` | The name of the hosts(5)-format file to search.
name:`bytes` | The name to search for.
Returns
`None` if the name is not found in the file, otherwise a `str` giving the address in the file associated with the name.