binlock.BinLock
- class binlock.BinLock(name: str = DEFAULT_LOCK_NAME)
Bases:
objectRepresents a bin lock file (.lck)
Methods
__init__([name])from_bin(bin_path[, missing_bin_ok])Get the existing lock for a given bin (.avb) path
from_path(lock_path)Read from .lck lockfile
hold_bin(bin_path[, missing_bin_ok])Context manager to hold a lock for a given bin (.avb) path
hold_lock(lock_path)Context manager to hold a lock at a given path
lock_bin(bin_path[, missing_bin_ok])Lock a given bin (.avb) with this lock
lock_path_from_bin_path(bin_path[, ...])Determine the lock path from a given bin path
remove_path(lock_path[, ownership_check])Remove a lock from at a given .lck path
to_path(lock_path)Write to .lck lockfile
unlock_bin(bin_path[, missing_bin_ok])Unlock a given bin (.avb)
Attributes
Name of the Avid the lock belongs to
- unlock_bin(bin_path: str, missing_bin_ok: bool = True)
Unlock a given bin (.avb)
For safety, the name on the bin lock MUST match the name on this BinLock instance
- classmethod from_bin(bin_path: str, missing_bin_ok: bool = True) BinLock | None
Get the existing lock for a given bin (.avb) path
Returns None if the bin is not locked