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`.`protocols`.`jabber`.`xmpp_stringprep`.`NamePrep``

class documentation

`class NamePrep: (source)`

View In Hierarchy

Implements preparation of internationalized domain names.

This class implements preparing internationalized domain names using the rules defined in RFC 3491, section 4 (Conversion operations).

We do not perform step 4 since we deal with unicode representations of domain names and do not convert from or to ASCII representations using punycode encoding. When such a conversion is needed, the `idna` standard library provides the `ToUnicode()` and `ToASCII()` functions. Note that `idna` itself assumes UseSTD3ASCIIRules to be false.

The following steps are performed by `prepare()`:

- Split the domain name in labels at the dots (RFC 3490, 3.1)
- Apply nameprep proper on each label (RFC 3491)
- Enforce the restrictions on ASCII characters in host names by assuming STD3ASCIIRules to be true. (STD 3)
- Rejoin the labels using the label separator U+002E (full stop).

Method | `check_prohibiteds` | Undocumented
Method | `nameprep` | Undocumented
Method | `prepare` | Undocumented
Class Variable | `prohibiteds` | Undocumented

def check_prohibiteds(self, string): (source)

Undocumented

def nameprep(self, label): (source)

Undocumented

def prepare(self, string): (source)

Undocumented

prohibiteds = (source)

Undocumented