wsgidav.lock_man.lock_manager#

Description

Implements the LockManager object that provides the locking functionality.

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

  • wsgidav.lock_man.lock_storage.LockStorageDict

  • wsgidav.lock_man.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

generate_lock_token()

is_lock_expired(lock)

lock_string(lock_dict)

Return readable rep.

normalize_lock_root(path)

validate_lock(lock)

Other Members

HTTP_LOCKED

int([x]) -> integer int(x, base=10) -> integer

PRECONDITION_CODE_LockConflict

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str