data_basedistributed_lockInterProcessLockNoWritePermission

InterProcessLockNoWritePermission

class data_base.distributed_lock.InterProcessLockNoWritePermission(path)

Check if the target file or directory has write access, and only lock it if so.

If the user has write permissions to the path, then locking is necessary. Otherwise not, and lock acquire returns True without a lock

Parameters:

path (str) – path to check.

Parameters:

path (str) – path to check.

Attributes:

lock

The lock object if the user has write permissions, None otherwise.

Type:

InterProcessLock or None

Methods:

acquire()

Acquire the lock on a path if the user has write permissions.

release()

Release the lock on a path if it was acquired.