wsgidav.util¶
Description
Miscellaneous support functions for WsgiDAV.
Classes
Functions
|
Append <response> element to <multistatus> element. |
|
Convert bytes into human-readable representation. |
|
Return base64 encoded binarystring. |
Return md5 digest for a string. |
|
|
Check if tags only contains known tags. |
|
Validate etag string to ensure propare comparison. |
|
|
|
Import a class from a module string, e.g. |
|
Import a class and instantiate with custom args. |
|
Import a class and instantiate with custom args. |
|
Handle 'If-...:' headers (but not 'If:' header). |
|
Wrapper to raise (and log) DAVError. |
|
Convert path to absolute, expand and check. |
|
Return a positive CONTENT_LENGTH in a safe way (return 0 otherwise). |
|
Return the value of a nested dict using dot-notation path. |
|
Return a strong, unquoted Entity Tag for a (file)path. |
|
|
|
Return <secs> in log time format (pass secs=None for current date). |
|
Create a module logger, that can be en/disabled by configuration. |
|
Return <secs> in rfc 1123 date/time format (pass secs=None for current date). |
|
Return <secs> in RFC 3339 date/time format (pass secs=None for current date). |
|
Return local name, i.e. last segment of URI. |
|
Return URI of parent collection with trailing '/', or None, if URI is top-level. |
|
Use the mimetypes module to lookup the type for an extension. |
|
Initialize base logger named 'wsgidav'. |
Return True for any string type (for str/unicode on Py2 and bytes/str on Py3). |
|
|
Return True for bytestrings (for str on Py2 and bytes on Py3). |
|
Return True, if child_uri is a child of parent_uri. |
|
Return True, if child_uri is a child of parent_uri or maps to the same resource. |
|
Return True for native strings (for str on Py2 and Py3). |
|
Append segments to URI. |
|
URL reconstruction according to PEP 333. |
|
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range |
|
Parse HTTP_IF header into a dictionary and lists, and cache the result. |
|
Return a list of etag-values for a If-Match or If-Not-Match header. |
|
Return the number of seconds since the epoch, for a date/time string. |
|
Read request body XML into an etree.Element. |
|
Return '/a/b/c' -> ('a', '/b/c'). |
|
Return '/a/b/c' -> ('a', 'b', '/c'). |
|
|
|
Convert a WSGI string to str, assuming the client used UTF-8. |
|
Read 1 byte from wsgi.input, if this has not been done yet. |
|
Return -1 if infinite, else return numofsecs. |
|
Replacement for str.removeprefix() (Py3.9+) with ignore_case option. |
|
Re-encode str or binary so that is compatible with a given encoding (replacing unsupported chars). |
|
Split string, always returning n-tuple (filled with None if necessary). |
|
|
|
Start a WSGI response for a DAVError or status code. |
|
Start a WSGI response for a DAVError or status code. |
|
Return ('/a', '/b/c') -> ('b', '/a/b', 'c'). |
|
Return (namespace, localname) tuple for a property name in Clark Notation. |
|
Return a string as hex dump. |
|
|
|
Convert a text string (unicode) to bytestring (str on Py2 and bytes on Py3). |
|
|
|
Convert data to native str type (bytestring on Py2 and unicode on Py3). |
Convert a binary string to Unicode using UTF-8 (fallback to ISO-8859-1). |
|
Convert an environment variable to a WSGI 'bytes-as-unicode' string. |
|
|
Modify or append new headers to existing header list (in-place). |
Convert a native string to a WSGI / HTTP compatible byte string. |
Other Members
|
The base logger (silent by default) |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
any numofsecs above the following limit is regarded as infinite |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
Compiled regular expression object. |
|
Compiled regular expression object. |
|
Compiled regular expression object. |
|
Compiled regular expression object. |
|
Compiled regular expression object. |
|
Compiled regular expression object. |
|
Compiled regular expression object. |