Package peppy :: Package vfs :: Package itools :: Package uri
[frames] | no frames]

Package uri

The purpose of this package is to implement URIs (Uniform Resource Identifiers) as specified by RFC2396.

Submodules

Classes
  Path
A path is a sequence of segments.
  Reference
A common URI reference is made of five components:
Functions
 
decode_query(data)
Decodes a query as defined by the "application/x-www-form-urlencoded" content type.
 
encode_query(query)
This method encodes a query as defined by the "application/x-www-form-urlencoded" content type (see http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1 for details)
 
get_reference(reference)
Returns a URI reference of the good type from the given string.
 
get_absolute_reference(reference, base=None)
Returns the absolute URI for the given reference.
 
get_absolute_reference2(reference, base=None)
Like "get_absolute_reference", but uses the "resolve2" algorithm (ignores trailing slashes).
 
register_scheme(name, handler)
 
get_scheme(name)
Function Details

decode_query(data)

 

Decodes a query as defined by the "application/x-www-form-urlencoded" content type.

The value expected is a byte string like "a=1&b=2"; the value returned is a dictonary like {'a': 1, 'b': 2}.

See http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1 for details.

encode_query(query)

 

This method encodes a query as defined by the "application/x-www-form-urlencoded" content type (see http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1 for details)

The value expected is a dictonary like {'a': 1, 'b': 2}. The value returned is a byte string like "a=1&b=2".

get_absolute_reference(reference, base=None)

 

Returns the absolute URI for the given reference. Uses "base" to resolve the reference, if "base" is not given default to the current working directory.