OPSI.web2.dav.util module

Utilities

This API is considered private to static.py and is therefore subject to change.

OPSI.web2.dav.util.allDataFromStream(stream, filter=None)
OPSI.web2.dav.util.davXMLFromStream(stream)
OPSI.web2.dav.util.noDataFromStream(stream)
OPSI.web2.dav.util.normalizeURL(url)

Normalized a URL. @param url: a URL. @return: the normalized representation of C{url}. The returned URL will

never contain a trailing C{“/”}; it is up to the caller to determine whether the resource referred to by the URL is a collection and add a trailing C{“/”} if so.
OPSI.web2.dav.util.joinURL(*urls)

Appends URLs in series. @param urls: URLs to join. @return: the normalized URL formed by combining each URL in C{urls}. The

returned URL will contain a trailing C{“/”} if and only if the last given URL contains a trailing C{“/”}.
OPSI.web2.dav.util.parentForURL(url)

Extracts the URL of the containing collection resource for the resource corresponding to a given URL. @param url: an absolute (server-relative is OK) URL. @return: the normalized URL of the collection resource containing the

resource corresponding to C{url}. The returned URL will always contain a trailing C{“/”}.
OPSI.web2.dav.util.bindMethods(module, clazz, prefixes=('preconditions_', 'http_', 'report_'))

Binds all functions in the given module (as defined by that module’s C{__all__} attribute) which start with any of the given prefixes as methods of the given class. @param module: the module in which to search for functions. @param clazz: the class to bind found functions to as methods. @param prefixes: a sequence of prefixes to match found functions against.