Exemple #1
0
 def __init__(self, context):
     """
     Constructor
     :param Context context: Thumbor's context
     """
     BaseStorage.__init__(self, context)
     AwsStorage.__init__(self, context, "TC_AWS_STORAGE")
Exemple #2
0
    def __init__(self, context):
        BaseStorage.__init__(self, context)

        self.storage = redis.Redis(port=self.context.config.REDIS_STORAGE_SERVER_PORT,
                                   host=self.context.config.REDIS_STORAGE_SERVER_HOST,
                                   db=self.context.config.REDIS_STORAGE_SERVER_DB,
                                   password=self.context.config.REDIS_STORAGE_SERVER_PASSWORD)
 def __init__(self, context):
     """
     Constructor
     :param Context context: Thumbor's context
     """
     BaseStorage.__init__(self, context)
     AwsStorage.__init__(self, context, 'TC_AWS_STORAGE')
Exemple #4
0
 def __init__(self, context):
     """
     Constructor
     :param Context context: Thumbor's context
     """
     BaseStorage.__init__(self, context)
     AwsStorage.__init__(self, context, 'TC_AWS_UPLOAD')
    def __init__(self, context):
        BaseStorage.__init__(self, context)

        self.storages = []
        for modpath in context.config.FAILOVER_STORAGE_OPTIONS:
            logging.debug("importing " + modpath)
            mod = importlib.import_module(modpath)
            self.storages.append(mod.Storage(context))
Exemple #6
0
    def __init__(self, context, file_storage=None, crypto_storage=None, detector_storage=None):
        BaseStorage.__init__(self, context)

        self.file_storage = file_storage

        self.crypto_storage = crypto_storage

        self.detector_storage = detector_storage
Exemple #7
0
 def __init__(self, context):
     """
     Constructor
     :param Context context: Thumbor's context
     """
     BaseStorage.__init__(self, context)
     AwsStorage.__init__(self, context, 'TC_AWS_STORAGE')
     self.storage_expiration_seconds = context.config.get('STORAGE_EXPIRATION_SECONDS', 3600)
    def __init__(self, context):
        BaseStorage.__init__(self, context)

        self.storage = pylibmc.Client(
            self.context.config.MEMCACHE_STORAGE_SERVERS,
            binary=True,
            behaviors={"tcp_nodelay": True, "no_block": True, "ketama": True},
        )
    def __init__(self, context):
        '''Initialize the MongoStorage

        :param thumbor.context.Context shared_client: Current context
        '''
        BaseStorage.__init__(self, context)
        self.database, self.storage = self.__conn__()
        super(Storage, self).__init__(context)
Exemple #10
0
    def __init__(self, context, file_storage=None, crypto_storage=None, detector_storage=None):
        BaseStorage.__init__(self, context)

        self.file_storage = file_storage

        self.crypto_storage = crypto_storage

        self.detector_storage = detector_storage
    def __init__(self, context, shared_client=True):
      ''' Init the MongoStorage
      :param thumbor.context.Context shared_client : Current Context
      :param boolean shared_client: When set to True a singleton client will be used.

      '''
      BaseStorage.__init__(self, context)
      self.shared_client = shared_client
      self.connection, self.db, self.storage = self.reconnect_mongo()
Exemple #12
0
    def __init__(self, context, shared_client=True):
        '''Initialize the RedisStorage
        :param thumbor.context.Context shared_client: Current context
        :param boolean shared_client: When set to True a singleton client will
                                      be used.
        '''

        BaseStorage.__init__(self, context)
        self.shared_client = shared_client
        self.storage = self.reconnect_redis()
Exemple #13
0
    def __init__(self, context, shared_client=True):
        '''Initialize the RedisStorage

        :param thumbor.context.Context shared_client: Current context
        :param boolean shared_client: When set to True a singleton client will
                                      be used.
        '''

        BaseStorage.__init__(self, context)
        self.shared_client = shared_client
        self.storage = self.reconnect_redis()
Exemple #14
0
    def __init__(self, context):
        BaseStorage.__init__(self, context)

        self.storage = pylibmc.Client(
            self.context.config.MEMCACHE_STORAGE_SERVERS,
            binary=True,
            behaviors={
                "tcp_nodelay": True,
                'no_block': True,
                "ketama": True
            })
Exemple #15
0
    def __init__(self, context):
        logging.debug('Instantiating S3 Storage')
        BaseStorage.__init__(self, context)

        access_key = context.config.S3_ACCESS_KEY_ID
        secret_key = context.config.S3_SECRET_ACCESS_KEY
        bucket = context.config.S3_BUCKET
        if access_key and secret_key:
            self.s3 = S3Connection(access_key, secret_key).create_bucket(bucket)
        else:
            # key passed in implicitly via AWS_ACCESS_KEY_ID and
            # AWS_SECRET_ACCESS_KEY environment variables
            self.s3 = S3Connection().create_bucket(bucket)

        regexes = context.config.S3_IGNORE_REGEXES
        self.regex = re.compile("|".join(regexes))
    def __init__(self, context):
        '''Initialize the RedisStorage

        :param thumbor.context.Context shared_client: Current context
        :param boolean shared_client: When set to True a singleton client will
                                      be used.
        '''

        BaseStorage.__init__(self, context)
        if not Storage.pool:
            Storage.pool = tornadis.ClientPool(
                max_size=self.context.config.get(
                    'REDIS_TORNADO_STORAGE_POOL_MAX_SIZE',
                    -1
                ),
                client_timeout=self.context.config.get(
                    'REDIS_TORNADO_STORAGE_CLIENT_TIMEOUT',
                    -1
                ),
                port=self.context.config.REDIS_STORAGE_SERVER_PORT,
                host=self.context.config.REDIS_STORAGE_SERVER_HOST,
                # db=self.context.config.REDIS_STORAGE_SERVER_DB,
                password=self.context.config.REDIS_STORAGE_SERVER_PASSWORD
            )
Exemple #17
0
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     self.dict = {}
Exemple #18
0
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     AwsStorage.__init__(self, context, 'STORAGE')
Exemple #19
0
    def __init__(self, context):
        BaseStorage.__init__(self, context)

        domain = self.context.config.MOGILEFS_STORAGE_DOMAIN
        trackers = self.context.config.MOGILEFS_STORAGE_TRACKERS
        self.storage = Client(domain=domain, trackers=trackers)
Exemple #20
0
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     self.storage = self.__get_s3_bucket()
Exemple #21
0
 def __init__(self,context):
   BaseStorage.__init__(self, context)
   if not self.context.config.CEPH_STORAGE_POOL:
     raise RuntimeError("CEPH_STORAGE_POOL undefined")
   self.storage = self.cluster.open_ioctx(self.context.config.CEPH_STORAGE_POOL)
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     mod = importlib.import_module(context.config.WRAPPER_RESULT_STORAGE)
     self.storage = mod.Storage(context)
     logging.debug('Instantiated Wrapper Result Storage')
    def __init__(self, context):
        BaseStorage.__init__(self, context)

        domain = self.context.config.MOGILEFS_STORAGE_DOMAIN
        trackers = self.context.config.MOGILEFS_STORAGE_TRACKERS
        self.storage = Client(domain=domain, trackers=trackers)
Exemple #24
0
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     self.storage = self.reconnect_redis()
Exemple #25
0
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     self.storage = self.reconnect_redis()
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     self.dict = {}
Exemple #27
0
 def __init__(self, context):
     BaseStorage.__init__(self, context)
     AwsStorage.__init__(self, context, 'STORAGE')
Exemple #28
0
 def __init__(self, context, shared_client=True):
     BaseStorage.__init__(self, context)
     self.shared_client = shared_client
     self.bucket = self._get_bucket()