util
index
/home/hermann/Entwürfe/hg/tinydav/tinydav/util.py

Utility functions and classes for tinydav WebDAV client.

 
Modules
       
posixpath
re
urlparse

 
Classes
       
__builtin__.object
FakeHTTPRequest

 
class FakeHTTPRequest(__builtin__.object)
    Fake HTTP request object needed for cookies.
 
See http://docs.python.org/library/cookielib.html#cookiejar-and-filecookiejar-objects
 
  Methods defined here:
__init__(self, client, uri, headers)
Initialize the fake HTTP request object.
 
client -- HTTPClient object or one of its subclasses.
uri -- The URI to call.
headers -- Headers dict to add cookie stuff to.
add_unredirected_header(self, key, header)
get_full_url(self)
get_host(self)
get_origin_req_host(self)
get_type(self)
has_header(self, name)
is_unverifiable(self)

Data descriptors defined here:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

 
Functions
       
extract_namespace(key)
Return the namespace in key or None, when no namespace is in key.
 
key -- String to get namespace from
get_depth(depth, allowed=('0', '1', 'infinity'))
Return string with depth.
 
depth -- Depth value to check.
allowed -- Iterable with allowed depth header values.
 
Raise ValueError, if an illegal depth was given.
make_absolute(httpclient, uri)
Return correct absolute URI.
 
httpclient -- HTTPClient instance with protocol, host and port attribute.
uri -- The destination path.
make_multipart(content, default_encoding='ascii', with_filenames=False)
Return the headers and content for multipart/form-data.
 
content -- Dict with content to POST. The dict values are expected to
           be unicode or decodable with us-ascii.
default_encoding -- Send multipart with this encoding, if no special 
                    encoding was given with the content. Default is ascii.
with_filenames -- If True, a multipart's files will be sent with the
                  filename paramenter set. Default is False.

 
Data
        __all__ = ('FakeHTTPRequest', 'make_absolute', 'make_multipart', 'extract_namespace', 'get_depth')