Exemple #1
0
    def __init__(self, cache_manager, options):
        BaseStorage.__init__(self, cache_manager, options)

        self.url = options.get('url', 'sqlite:///')
        self.tablename = options.get('table_name', 'session')
        self.auto_create = options.get('auto_create', True)
        self.db, self.meta, self.table = create_table(self.url, self.tablename, self.auto_create)
 def __init__(self, server, params):
     BaseStorage.__init__(self, params)
     host, port = server.split(':')
     try:
         port = int(port)
     except ValueError:
         raise ImproperlyConfigured("Invalid port provided for tokyo-tyrant key-value store backend")
     self._db = pytyrant.PyTyrant.open(host, port)
    def __init__(self, cache_manager, options):
        BaseStorage.__init__(self, cache_manager, options)

        self.url = options.get('url', 'sqlite:///')
        self.tablename = options.get('table_name', 'session')
        self.auto_create = options.get('auto_create', True)
        self.db, self.meta, self.table = create_table(self.url, self.tablename,
                                                      self.auto_create)
Exemple #4
0
 def __init__(self, server, params):
     if ':' in server:
         host, port = server.split(':')
         port = int(port)
     else:
         host, port = server, None
     params['port'] = port
     BaseStorage.__init__(self, params)
     self._db = redis.Redis(host=host, **params)
Exemple #5
0
 def __init__(self, server, params):
     if ':' in server:
         host, port = server.split(':')
         port = int(port)
     else:
         host, port = server, None
     params['port'] = port
     BaseStorage.__init__(self, params)
     self._db = redis.Redis(host=host, **params)
Exemple #6
0
 def __init__(self, domain, params):
     BaseStorage.__init__(self, params)
     params = dict(params)
     try:
         aws_access_key = params['aws_access_key']
         aws_secret_access_key = params['aws_secret_access_key']
     except KeyError:
         raise ImproperlyConfigured("Incomplete configuration of SimpleDB key-value store. Required parameters: 'aws_access_key', and 'aws_secret_access_key'.")
     self._db = simpledb.SimpleDB(aws_access_key, aws_secret_access_key)
     self._domain = self._db[domain]
Exemple #7
0
 def __init__(self, server, params):
     BaseStorage.__init__(self, params)
     host, port = server.split(':')
     try:
         port = int(port)
     except ValueError:
         raise ImproperlyConfigured(
             "Invalid port provided for tokyo-tyrant key-value store backend"
         )
     self._db = pytyrant.PyTyrant.open(host, port)
Exemple #8
0
 def __init__(self,
              cache_manager,
              options,
              file_dir_name='session_files',
              lock_dir_name='session_files_lock'):
     BaseStorage.__init__(self, cache_manager, options)
     self.data_dir = options.get('data_dir', './sessions')
     self.file_dir = options.get('file_dir') or os.path.join(
         self.data_dir, file_dir_name)
     self.lock_dir = options.get('lock_dir') or os.path.join(
         self.data_dir, lock_dir_name)
Exemple #9
0
 def __init__(self, domain, params):
     BaseStorage.__init__(self, params)
     params = dict(params)
     try:
         aws_access_key = params['aws_access_key']
         aws_secret_access_key = params['aws_secret_access_key']
     except KeyError:
         raise ImproperlyConfigured(
             "Incomplete configuration of SimpleDB key-value store. Required parameters: 'aws_access_key', and 'aws_secret_access_key'."
         )
     self._db = simpledb.SimpleDB(aws_access_key, aws_secret_access_key)
     self._domain = self._db[domain]
    def __init__(self, cache_manager, options):
        """
        options =
            connection = ['localhost:11211']
            module = None
        """
        BaseStorage.__init__(self, cache_manager, options)
        if not options.get('connection'):
            options['connection'] = ['localhost:11211']

        self.client = self.import_preferred_memcache_lib(options)
        if self.client is None:
            raise Error('no memcache module found')
Exemple #11
0
    def __init__(self, cache_manager, options):
        """
        options =
            connection = ['localhost:11211']
            module = None
        """
        BaseStorage.__init__(self, cache_manager, options)
        if not options.get('connection'):
            options['connection'] = ['localhost:11211']

        self.client = self.import_preferred_memcache_lib(options)
        if self.client is None:
            raise Error('no memcache module found')
Exemple #12
0
    def __init__(self, cache_manager, options):
        """
        options =
            unix_socket_path = '/tmp/redis.sock'
            or
            connection_pool = {'host':'localhost', 'port':6379, 'db':0}
        """
        BaseStorage.__init__(self, cache_manager, options)

        if 'unix_socket_path' in options:
            self.client = redis.Redis(unix_socket_path=options['unix_socket_path'])
        else:
            global __connection_pool__
        
            if not __connection_pool__ or __connection_pool__[0] != options['connection_pool']:
                d = {'host':'localhost', 'port':6379}
                d.update(options['connection_pool'])
                __connection_pool__ = (d, redis.ConnectionPool(**d))
            self.client = redis.Redis(connection_pool=__connection_pool__[1])
Exemple #13
0
    def __init__(self, cache_manager, options):
        """
        options =
            unix_socket_path = '/tmp/redis.sock'
            or
            connection_pool = {'host':'localhost', 'port':6379, 'db':0}
        """
        BaseStorage.__init__(self, cache_manager, options)

        self._type = (int, long)
        
        if 'unix_socket_path' in options:
            self.client = redis.Redis(unix_socket_path=options['unix_socket_path'])
        else:
            global __connection_pool__
        
            if not __connection_pool__ or __connection_pool__[0] != options['connection_pool']:
                d = {'host':'localhost', 'port':6379}
                d.update(options['connection_pool'])
                __connection_pool__ = (d, redis.ConnectionPool(**d))
            self.client = redis.Redis(connection_pool=__connection_pool__[1])
 def __init__(self, table=None, params=None):
     BaseStorage.__init__(self, params)
     self._model = DjangoKVStore
Exemple #15
0
 def __init__(self, server, params):
     BaseStorage.__init__(self, params)
     self._db = memcache.Client(server.split(";"))
Exemple #16
0
 def __init__(self, cache_manager, options):
     BaseStorage.__init__(self, cache_manager, options)
     self.data_dir = options.get('data_dir', './sessions')
     self.file_dir = options.get('file_dir') or os.path.join(self.data_dir, 'session_files')
     self.lock_dir = options.get('lock_dir') or os.path.join(self.data_dir, 'session_files_lock')
Exemple #17
0
 def __init__(self, server, params):
     BaseStorage.__init__(self, params)
     self._db = memcache.Client(server.split(';'))
Exemple #18
0
 def __init__(self, _, params):
     BaseStorage.__init__(self, params)
     self._db = {}
     self._lock = RWLock()
Exemple #19
0
 def __init__(self, _, params):
     BaseStorage.__init__(self, params)
     self._db = {}
     self._lock = RWLock()