Attention

You are looking at outdated documentation for version 2.x. A newer version is available.

wsgidav.lock_manager

Description

Implements the LockManager object that provides the locking functionality.

The LockManager requires a LockStorage object to implement persistence. Two alternative lock storage classes are defined in the lock_storage module:

  • wsgidav.lock_storage.LockStorageDict
  • wsgidav.lock_storage.LockStorageShelve

The lock data model is a dictionary with these fields:

root:
Resource URL.
principal:
Name of the authenticated user that created the lock.
type:
Must be ‘write’.
scope:
Must be ‘shared’ or ‘exclusive’.
depth:
Must be ‘0’ or ‘infinity’.
owner:
String identifying the owner.
timeout:
Seconds remaining until lock expiration. This value is passed to create() and refresh()
expire:
Converted timeout for persistence: expire = time() + timeout.
token:
Automatically generated unique token.

Classes

LockManager(storage) Implements locking functionality using a custom storage layer.

Functions

generateLockToken()
isLockExpired(lock)
lockString(lockDict) Return readable rep.
normalizeLockRoot(path)
validateLock(lock)

Other Members

DAVError(statusCode[, contextinfo, …]) General error class that is used to signal HTTP and WEBDAV errors.
DAVErrorCondition(conditionCode) May be embedded in DAVError instances to store additional data.
HTTP_LOCKED int(x=0) -> int or long int(x, base=10) -> int or long
PRECONDITION_CODE_LockConflict str(object=’‘) -> string
ReadWriteLock() Read-Write lock class.
compat Tool functions to support Python 2 and 3.
pformat(object[, indent, width, depth]) Format a Python object into a pretty-printed representation.
random Random variable generators.
time This module provides various functions to manipulate time values.
util Miscellaneous support functions for WsgiDAV.