twisted.python._url
module documentationtwisted.python
View Source
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 . |
Normalise the URL path by resolving segments of '.' and '..'.
Parameters | path | list of path segments |
Returns | a new list
of path segments with the '.' and '..' elements removed and resolved. | |
See Also | RFC 3986 section 5.2.4, Remove Dot Segments |
If the given value is _unspecified
, return
default
; otherwise return argument
.
Parameters | argument | The argument passed. |
default | The default to use if argument is _unspecified . | |
Returns | argument or default |
Check that the given value
is of the given
type
, or raise an exception describing the problem using
name
.
Parameters | name | a name to use to describe the type mismatch in the error if one occurs (type: native str ) |
value | the value to check (type: object ) | |
types | the expected types of value (type: tuple
of type ) | |
Returns | value if the type check succeeds | |
Raises | TypeError | if there is a type mismatch between value and
type |