index 36833d0e1a2914d7ab7e29abe1be91b509b83b2b..5702609f2a41666d80f5bccb1ec10080c794ce9e 100644 (file)
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
-# $Id: locking.py,v 1.7 2003-07-03 23:43:46 richard Exp $
+# $Id: locking.py,v 1.8 2004-02-11 23:55:09 richard Exp $
'''This module provides a generic interface to acquire and release
exclusive access to a file.
It should work on Unix and Windows.
'''
+__docformat__ = 'restructuredtext'
-import portalocker
+from roundup.backends import portalocker
def acquire_lock(path, block=1):
'''Acquire a lock for the given path
'''
- import portalocker
file = open(path, 'w')
if block:
portalocker.lock(file, portalocker.LOCK_EX)