Attention

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

wsgidav.lock_storage.LockStorageDict

class wsgidav.lock_storage.LockStorageDict[source]

Bases: object

An in-memory lock manager storage implementation using a dictionary.

R/W access is guarded by a thread.lock object.

Also, to make it work with a Shelve dictionary, modifying dictionary members is done by re-assignment and we call a _flush() method.

This is obviously not persistent, but should be enough in some cases. For a persistent implementation, see lock_manager.LockStorageShelve().

Notes

expire is stored as expiration date in seconds since epoch (not in seconds until expiration).

The dictionary is built like:

  { 'URL2TOKEN:/temp/litmus/lockme': ['opaquelocktoken:0x1d7b86...',
                                      'opaquelocktoken:0xd7d4c0...'],
    'opaquelocktoken:0x1d7b86...': { 'depth': '0',
                                     'owner': "<?xml version='1.0' encoding='UTF-8'?>\n<owner xmlns="DAV:">litmus test suite</owner>\n",
                                     'principal': 'tester',
                                     'root': '/temp/litmus/lockme',
                                     'scope': 'shared',
                                     'expire': 1261328382.4530001,
                                     'token': 'opaquelocktoken:0x1d7b86...',
                                     'type': 'write',
                                     },
    'opaquelocktoken:0xd7d4c0...': { 'depth': '0',
                                     'owner': '<?xml version='1.0' encoding='UTF-8'?>\n<owner xmlns="DAV:">litmus: notowner_sharedlock</owner>\n',
                                     'principal': 'tester',
                                     'root': '/temp/litmus/lockme',
                                     'scope': 'shared',
                                     'expire': 1261328381.6040001,
                                     'token': 'opaquelocktoken:0xd7d4c0...',
                                     'type': 'write'
                                     },
   }

.. autosummary::
   :toctree:

   LockStorageDict.LOCK_TIME_OUT_DEFAULT
   LockStorageDict.LOCK_TIME_OUT_MAX





.. autosummary::
   :toctree:

   LockStorageDict.cleanup
   LockStorageDict.clear
   LockStorageDict.close
   LockStorageDict.create
   LockStorageDict.delete
   LockStorageDict.get
   LockStorageDict.getLockList
   LockStorageDict.open
   LockStorageDict.refresh