URL parsing, construction and rendering.

Function _minimalPercentEncode Percent-encode only the characters that are syntactically necessary for serialization, preserving any IRI-style textual data.
Function _maximalPercentEncode Percent-encode everything required to convert a portion of an IRI to a portion of a URI.
Function _percentDecode Replace percent-encoded characters with their UTF-8 equivalents.
Function _resolveDotSegments Normalise the URL path by resolving segments of '.' and '..'.
Function _optional If the given value is _unspecified, return default; otherwise return argument.
Function _typecheck Check that the given value is of the given type, or raise an exception describing the problem using name.
def _minimalPercentEncode(text, safe): (source)

Percent-encode only the characters that are syntactically necessary for serialization, preserving any IRI-style textual data.

Parameterstextthe text to escaped (type: unicode)
safecharacters safe to include in the return value (type: unicode)
Returnsthe encoded version of text (type: unicode)
def _maximalPercentEncode(text, safe): (source)

Percent-encode everything required to convert a portion of an IRI to a portion of a URI.

Parameterstextthe text to encode. (type: unicode)
safea string of safe characters. (type: unicode)
Returnsthe encoded version of text (type: unicode)
def _percentDecode(text): (source)

Replace percent-encoded characters with their UTF-8 equivalents.

ParameterstextThe text with percent-encoded UTF-8 in it. (type: unicode)
Returnsthe encoded version of text (type: unicode)
def _resolveDotSegments(path): (source)

Normalise the URL path by resolving segments of '.' and '..'.

Parameterspathlist of path segments
Returnsa new list of path segments with the '.' and '..' elements removed and resolved.
See AlsoRFC 3986 section 5.2.4, Remove Dot Segments
def _optional(argument, default): (source)

If the given value is _unspecified, return default; otherwise return argument.

ParametersargumentThe argument passed.
defaultThe default to use if argument is _unspecified.
Returnsargument or default
def _typecheck(name, value, *types): (source)

Check that the given value is of the given type, or raise an exception describing the problem using name.

Parametersnamea name to use to describe the type mismatch in the error if one occurs (type: native str)
valuethe value to check (type: object)
typesthe expected types of value (type: tuple of type)
Returnsvalue if the type check succeeds
RaisesTypeErrorif there is a type mismatch between value and type
API Documentation for Twisted, generated by pydoctor at 2017-02-11 20:06:04.