[Python-modules-commits] [python-cachecontrol] 01/03: Import python-cachecontrol_0.11.5.orig.tar.gz

Barry Warsaw barry at moszumanska.debian.org
Mon Jun 1 19:48:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

barry pushed a commit to branch master
in repository python-cachecontrol.

commit b6e96a62dc9ba104fccec9a5693d4a1be64ccb3a
Author: Barry Warsaw <barry at python.org>
Date:   Mon Jun 1 15:02:22 2015 -0400

    Import python-cachecontrol_0.11.5.orig.tar.gz
---
 CacheControl.egg-info/PKG-INFO     |  2 +-
 CacheControl.egg-info/requires.txt |  2 +-
 PKG-INFO                           |  2 +-
 cachecontrol/__init__.py           |  2 +-
 cachecontrol/caches/file_cache.py  | 19 ++++++++++++++++---
 setup.py                           |  4 ++--
 6 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/CacheControl.egg-info/PKG-INFO b/CacheControl.egg-info/PKG-INFO
index a38bcc0..73e3419 100644
--- a/CacheControl.egg-info/PKG-INFO
+++ b/CacheControl.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: CacheControl
-Version: 0.11.4
+Version: 0.11.5
 Summary: httplib2 caching for requests
 Home-page: https://github.com/ionrock/cachecontrol
 Author: Eric Larson
diff --git a/CacheControl.egg-info/requires.txt b/CacheControl.egg-info/requires.txt
index f330760..769f510 100644
--- a/CacheControl.egg-info/requires.txt
+++ b/CacheControl.egg-info/requires.txt
@@ -1,4 +1,4 @@
 requests
 
 [filecache]
-lockfile
+lockfile>=0.9
diff --git a/PKG-INFO b/PKG-INFO
index a38bcc0..73e3419 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: CacheControl
-Version: 0.11.4
+Version: 0.11.5
 Summary: httplib2 caching for requests
 Home-page: https://github.com/ionrock/cachecontrol
 Author: Eric Larson
diff --git a/cachecontrol/__init__.py b/cachecontrol/__init__.py
index 5e1f659..d6af9b9 100644
--- a/cachecontrol/__init__.py
+++ b/cachecontrol/__init__.py
@@ -4,7 +4,7 @@ Make it easy to import from cachecontrol without long namespaces.
 """
 __author__ = 'Eric Larson'
 __email__ = 'eric at ionrock.org'
-__version__ = '0.11.4'
+__version__ = '0.11.5'
 
 from .wrapper import CacheControl
 from .adapter import CacheControlAdapter
diff --git a/cachecontrol/caches/file_cache.py b/cachecontrol/caches/file_cache.py
index fd12c8a..504ad1e 100644
--- a/cachecontrol/caches/file_cache.py
+++ b/cachecontrol/caches/file_cache.py
@@ -1,7 +1,8 @@
 import hashlib
 import os
 
-from lockfile import FileLock
+from lockfile import LockFile
+from lockfile.mkdirlockfile import MkdirLockFile
 
 from ..cache import BaseCache
 from ..controller import CacheController
@@ -49,11 +50,23 @@ def _secure_open_write(filename, fmode):
 
 class FileCache(BaseCache):
     def __init__(self, directory, forever=False, filemode=0o0600,
-                 dirmode=0o0700):
+                 dirmode=0o0700, use_dir_lock=None, lock_class=None):
+
+        if use_dir_lock is not None and lock_class is not None:
+            raise ValueError("Cannot use use_dir_lock and lock_class together")
+
+        if use_dir_lock:
+            lock_class = MkdirLockFile
+
+        if lock_class is None:
+            lock_class = LockFile
+
         self.directory = directory
         self.forever = forever
         self.filemode = filemode
         self.dirmode = dirmode
+        self.lock_class = lock_class
+
 
     @staticmethod
     def encode(x):
@@ -83,7 +96,7 @@ class FileCache(BaseCache):
         except (IOError, OSError):
             pass
 
-        with FileLock(name) as lock:
+        with self.lock_class(name) as lock:
             # Write our actual file
             with _secure_open_write(lock.path, self.filemode) as fh:
                 fh.write(value)
diff --git a/setup.py b/setup.py
index 7feb020..e04a213 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ import setuptools
 
 long_description = open('README.rst').read()
 
-VERSION = '0.11.4'
+VERSION = '0.11.5'
 
 setup_params = dict(
     name='CacheControl',
@@ -21,7 +21,7 @@ setup_params = dict(
         'requests',
     ],
     extras_require={
-        'filecache': ['lockfile'],
+        'filecache': ['lockfile>=0.9'],
     },
     classifiers=[
         'Development Status :: 4 - Beta',

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-cachecontrol.git



More information about the Python-modules-commits mailing list