Commits

Jason R. Coombs  committed e145262

Renamed lock_util to locking.py

  • Participants
  • Parent commits 8192c6f

Comments (0)

Files changed (3)

File cherrypy/lib/lock_util.py

-
-class Timer:
-    "stubbed"
-class NeverExpires:
-    "stubbed"
-class LockTimeout:
-    "stubbed"
-
-class LockChecker(object):
-    """
-    Keep track of the time and detect if a timeout has expired
-    """
-    def __init__(self, session_id, timeout):
-        self.session_id = session_id
-        if timeout:
-            self.timer = Timer.after(timeout)
-        else:
-            self.timer = NeverExpires()
-
-    def expired(self):
-        if self.timer.expired():
-            raise LockTimeout(
-                "Timeout acquiring lock for %(session_id)s" % vars(self))
-        return False

File cherrypy/lib/locking.py

+
+class Timer:
+    "stubbed"
+class NeverExpires:
+    "stubbed"
+class LockTimeout:
+    "stubbed"
+
+class LockChecker(object):
+    """
+    Keep track of the time and detect if a timeout has expired
+    """
+    def __init__(self, session_id, timeout):
+        self.session_id = session_id
+        if timeout:
+            self.timer = Timer.after(timeout)
+        else:
+            self.timer = NeverExpires()
+
+    def expired(self):
+        if self.timer.expired():
+            raise LockTimeout(
+                "Timeout acquiring lock for %(session_id)s" % vars(self))
+        return False

File cherrypy/lib/sessions.py

 import cherrypy
 from cherrypy._cpcompat import copyitems, pickle, random20, unicodestr
 from cherrypy.lib import httputil
-from cherrypy.lib import lock_util
+from cherrypy.lib import locking
 
 
 missing = object()
         if path is None:
             path = self._get_file_path()
         path += self.LOCK_SUFFIX
-        checker = lock_util.LockChecker(self.lock_timeout)
+        checker = locking.LockChecker(self.lock_timeout)
         while not checker.expired():
             # always try once
             try: