{ "info": { "author": "Jakub Dor\u0148\u00e1k", "author_email": "jdornak@redhat.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License" ], "description": "python-flock\r\n============\r\n\r\nflock.Flock(fd, op)\r\n-------------------\r\n\r\nFlock object uses `fcntl.flock` to lock (resp. unlock)\r\nfile descriptor (`fd`) with operation (`op`)\r\nwhen entering (resp. leaving) runtime context related to it.\r\n\r\nFile objects providing a `fileno()` method are accepted as well.\r\n\r\nOperation is one of the following values:\r\n \r\n * `LOCK_SH` - acquire a shared lock\r\n * `LOCK_EX` - acquire an exclusive lock\r\n\r\nOperation can also be bitwise ORed with `LOCK_NB`\r\nto avoid blocking on lock acquisition.\r\n\r\n\r\nExample:\r\n--------\r\n\r\n with open('/tmp/file.lock', 'w') as f:\r\n blocking_lock = flock.Flock(f, flock.LOCK_EX)\r\n noblocking_lock = flock.Flock(f, flock.LOCK_EX|flock.LOCK_NB)\r\n\r\n with blocking_lock:\r\n pass # do something here\r\n\r\n try:\r\n with noblocking_lock:\r\n pass # do something else here\r\n except BlockingIOError:\r\n pass", "description_content_type": null, "docs_url": null, "download_url": "https://github.srcurl.net/misli/python-flock/0.1/python-flock-0.1.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/misli/python-flock", "keywords": "with flock", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "flock", "package_url": "https://pypi.org/project/flock/", "platform": "Python 3", "project_url": "https://pypi.org/project/flock/", "project_urls": { "Download": "https://github.srcurl.net/misli/python-flock/0.1/python-flock-0.1.tar.gz", "Homepage": "https://github.com/misli/python-flock" }, "release_url": "https://pypi.org/project/flock/0.1/", "requires_dist": null, "requires_python": null, "summary": "Flock object uses fcntl.flock to lock (resp. unlock) file descriptor (fd) with operation (op) when entering (resp. leaving) runtime context related to it.", "version": "0.1" }, "last_serial": 2497384, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8776bd833a3ed95e675b558889f3cb3d", "sha256": "d22394893809ac2e2189b793e391d165d84c520c54f5360236d79616d68beaf5" }, "downloads": -1, "filename": "flock-0.1.tar.gz", "has_sig": false, "md5_digest": "8776bd833a3ed95e675b558889f3cb3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1365, "upload_time": "2014-10-01T12:18:39", "url": "https://files.pythonhosted.org/packages/ab/26/49e7f1b7a4c59731fd4c42b5e9acaf572999f4126bfc61ac23968b543ed3/flock-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8776bd833a3ed95e675b558889f3cb3d", "sha256": "d22394893809ac2e2189b793e391d165d84c520c54f5360236d79616d68beaf5" }, "downloads": -1, "filename": "flock-0.1.tar.gz", "has_sig": false, "md5_digest": "8776bd833a3ed95e675b558889f3cb3d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1365, "upload_time": "2014-10-01T12:18:39", "url": "https://files.pythonhosted.org/packages/ab/26/49e7f1b7a4c59731fd4c42b5e9acaf572999f4126bfc61ac23968b543ed3/flock-0.1.tar.gz" } ] }