Commits

Ben Bangert committed e093b06

Import clean-ups, PEP 8

  • Participants
  • Parent commits 68c57f4

Comments (0)

Files changed (9)

-import warnings
 import beaker.container as container
 from beaker.exceptions import InvalidCacheBackendError
-from beaker.util import coerce_cache_params
 import beaker.util as util
 
 clsmap = {

beaker/container.py

 import cPickle
 import logging
 import os.path
-import string
-import sys
 import time
 
 from beaker.exceptions import MissingCacheParameter
 import beaker.util as util
-from beaker.synchronization import _threading, _thread, file_synchronizer, mutex_synchronizer, NameLock
+from beaker.synchronization import _threading, file_synchronizer, mutex_synchronizer, NameLock
 
 __all__ = ['ContainerContext', 'Value', 'Container', 
            'MemoryContainer', 'DBMContainer', 'NamespaceManager',

beaker/ext/database.py

 
 from beaker.container import NamespaceManager, Container
 from beaker.exceptions import InvalidCacheBackendError, MissingCacheParameter
-from beaker.synchronization import file_synchronizer, _threading, null_synchronizer
+from beaker.synchronization import file_synchronizer, null_synchronizer
 from beaker.util import verify_directory, SyncDict
 
 sa_version = None

beaker/ext/google.py

 from __future__ import absolute_import
 import cPickle
 import logging
-import re
 from datetime import datetime
 
 from beaker.container import NamespaceManager, Container
-from beaker.exceptions import InvalidCacheBackendError, MissingCacheParameter
+from beaker.exceptions import InvalidCacheBackendError
 from beaker.synchronization import null_synchronizer
 
 log = logging.getLogger(__name__)

beaker/ext/memcached.py

-import sys
-
 from beaker.container import NamespaceManager, Container
 from beaker.exceptions import InvalidCacheBackendError, MissingCacheParameter
-from beaker.synchronization import _threading, file_synchronizer, null_synchronizer
-
+from beaker.synchronization import file_synchronizer, null_synchronizer
 from beaker.util import verify_directory, SyncDict
 
 try:

beaker/ext/sqla.py

 
 from beaker.container import NamespaceManager, Container
 from beaker.exceptions import InvalidCacheBackendError, MissingCacheParameter
-from beaker.synchronization import file_synchronizer, _threading, null_synchronizer
+from beaker.synchronization import file_synchronizer, null_synchronizer
 from beaker.util import verify_directory, SyncDict
 
 try:

beaker/middleware.py

-import sys
 import warnings
 
 try:

beaker/session.py

 class Session(dict):
     "session object that uses container package for storage"
 
-    def __init__(self, 
-                    request, 
-                    id=None, 
-                    invalidate_corrupt=False, 
-                    use_cookies=True, 
-                    type=None, 
-                    data_dir=None, 
-                    key='beaker.session.id', 
-                    timeout=None, 
-                    cookie_expires=True,
-                    cookie_domain=None, 
-                    secret=None, 
-                    secure=False, 
-                    namespace_class=None, 
-                    **namespace_args):
-        
+    def __init__(self, request, id=None, invalidate_corrupt=False,
+                 use_cookies=True, type=None, data_dir=None,
+                 key='beaker.session.id', timeout=None, cookie_expires=True,
+                 cookie_domain=None, secret=None, secure=False,
+                 namespace_class=None, **namespace_args):
         if not type:
             if data_dir:
                 self.type = 'file'

beaker/synchronization.py

-__all__  = ["file_synchronizer", "mutex_synchronizer", "null_synchronizer", "NameLock", "_threading", "_thread"]
+__all__  = ["file_synchronizer", "mutex_synchronizer", "null_synchronizer", "NameLock", "_threading"]
 
 import os
 import sys
 import tempfile
 
 try:
-    import thread as _thread
     import threading as _threading
 except ImportError:
-    import dummy_thread as _thread
     import dummy_threading as _threading
 
 # check for fcntl module
             except IOError:
                 return False
         else:
-            fcntl.flock(filedescriptor, fcntl.LOCK_EX);
+            fcntl.flock(filedescriptor, fcntl.LOCK_EX)
             return True
     
     def do_release_read_lock(self):
                 # yes. so if a sync operation is waiting, notifyAll to wake
                 # it up
                 if self.current_sync_operation is not None:
-                        self.condition.notifyAll()
+                    self.condition.notifyAll()
             elif self.async < 0:
                 raise LockError("Synchronizer error - too many release_read_locks called")
         finally: