A simple lock file class based on file locking.
Project description
flockfile
Just a simple python lock file class using file locks.
Installation
pip install flockfile
Usage
from flockfile import FlockFile, FileNotLocked
# init the class using a file name
# optionally, the directory can be set to something other than /tmp
lock = FlockFile("myscriptname", lock_dir="/tmp")
# lock the file
lock.lock()
# if this is unsuccessful, exception FileNotLocked will be raised.
# the following class method can be used to check lock status
assert lock.check_lock()
# unlock and delete file
lock.unlock()
Questions or Issues?
Please report as a Gitlab issue: https://gitlab.com/rveach/flockfile/issues
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
flockfile-0.1.2.tar.gz
(2.5 kB
view details)
File details
Details for the file flockfile-0.1.2.tar.gz
.
File metadata
- Download URL: flockfile-0.1.2.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.8.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f39d15a85ff1cbc2a39af8ae6da557deb646d526093c241537ec92052a7ec905 |
|
MD5 | e400bf55815742215da0540ffce6c285 |
|
BLAKE2b-256 | 5a3816f92287c9ab49e1cec1fe8d77b24bd155b41b46352bf0cf2c76679cde5f |