Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/yougov/yg.lockfile
https://github.com/yougov/yg.lockfile
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/yougov/yg.lockfile
- Owner: yougov
- License: mit
- Created: 2016-12-29T20:32:01.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-22T18:48:01.000Z (over 6 years ago)
- Last Synced: 2024-05-02T00:07:42.579Z (8 months ago)
- Language: Python
- Size: 79.1 KB
- Stars: 1
- Watchers: 4
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- License: LICENSE
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/yg.lockfile.svg
:target: https://pypi.org/project/yg.lockfile.. image:: https://img.shields.io/pypi/pyversions/yg.lockfile.svg
.. image:: https://img.shields.io/travis/yougov/yg.lockfile/master.svg
:target: https://travis-ci.org/yougov/yg.lockfile.. .. image:: https://img.shields.io/appveyor/ci/jaraco/skeleton/master.svg
.. :target: https://ci.appveyor.com/project/jaraco/skeleton/branch/master.. .. image:: https://readthedocs.org/projects/skeleton/badge/?version=latest
.. :target: https://skeleton.readthedocs.io/en/latest/?badge=latestA FileLock class that implements a context manager with timeouts on top of
`zc.lockfile`, an excellent, cross-platorm implementation of file locking.Usage
=====Example usage::
import yg.lockfile
try:
with yg.lockfile.FileLock('/tmp/lockfile', timeout=900):
protected_operation()
except yg.lockfile.FileLockTimeout:
handle_unable_to_lock()