Package peppy :: Package vfs :: Package itools :: Package uri :: Module generic :: Class Reference
[frames] | no frames]

Class Reference

object --+
         |
        Reference
Known Subclasses:


A common URI reference is made of five components:

- the scheme
- the authority
- the path
- the query
- the fragment

Its syntax is:

  <scheme>://<authority><path>?<query>#<fragment>

Not all the components must be present, examples of possible references
include:

http://www.example.com
http://www.ietf.org/rfc/rfc2616.txt
/rfc/rfc2616.txt
XXX

Instance Methods
 
__init__(self, scheme, authority, path, query, fragment=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
 
__str__(self)
str(x)
 
__unicode__(self)
 
__eq__(self, other)
 
__hash__(self)
hash(x)
 
resolve(self, reference)
Resolve the given relative URI, this URI (self) is considered to be the base.
 
resolve2(self, reference)
This is much like 'resolv', but uses 'Path.resolve2' method instead.
 
replace(self, **kw)
This method returns a new uri reference, equal to this one, but with the given keyword parameters set in the query.

Inherited from object: __delattr__, __getattribute__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__

Properties
  authority
  fragment
  path
  query
  scheme

Inherited from object: __class__

Method Details

__init__(self, scheme, authority, path, query, fragment=None)
(Constructor)

 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

__str__(self)
(Informal representation operator)

 

str(x)

Overrides: object.__str__
(inherited documentation)

__hash__(self)
(Hashing function)

 

hash(x)

Overrides: object.__hash__
(inherited documentation)

resolve(self, reference)

 

Resolve the given relative URI, this URI (self) is considered to be the base.

If the given uri is not relative, it is returned. If 'self' is not absolute, the result is undefined.

resolve2(self, reference)

 

This is much like 'resolv', but uses 'Path.resolve2' method instead.

XXX Too much code is duplicated, the only difference beween 'resolve' and 'resolve2' is one character. Refactor!