Randy Syring avatar Randy Syring committed 954ff5f

need with_statement future for memcached (+whitespace changes)

Comments (0)

Files changed (1)

beaker/ext/memcached.py

+from __future__ import with_statement
 from beaker.container import NamespaceManager, Container
 from beaker.exceptions import InvalidCacheBackendError, MissingCacheParameter
 from beaker.synchronization import file_synchronizer, null_synchronizer
         else:
             return object.__new__(MemcachedNamespaceManager)
 
-    def __init__(self, namespace, url, 
-                        memcache_module='auto', 
-                        data_dir=None, lock_dir=None, 
+    def __init__(self, namespace, url,
+                        memcache_module='auto',
+                        data_dir=None, lock_dir=None,
                         **kw):
         NamespaceManager.__init__(self, namespace)
 
         _memcache_module = _client_libs[memcache_module]
 
         if not url:
-            raise MissingCacheParameter("url is required") 
+            raise MissingCacheParameter("url is required")
 
         if lock_dir:
             self.lock_dir = lock_dir
             verify_directory(self.lock_dir)
 
         self.mc = MemcachedNamespaceManager.clients.get(
-                        (memcache_module, url), 
-                        _memcache_module.Client, 
+                        (memcache_module, url),
+                        _memcache_module.Client,
                         url.split(';'))
 
     def get_creation_lock(self, key):
         return file_synchronizer(
-            identifier="memcachedcontainer/funclock/%s" % 
+            identifier="memcachedcontainer/funclock/%s" %
                     self.namespace,lock_dir = self.lock_dir)
 
     def _format_key(self, key):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.