Esempio n. 1
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
                return storage.get_crypto(IMAGE_URL % "9999")
Esempio n. 2
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
            return storage.exists(IMAGE_URL % "9999")
Esempio n. 3
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            return storage.exists(IMAGE_URL % '9999')
Esempio n. 4
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                return storage.get_crypto(IMAGE_URL % '9999')
Esempio n. 5
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            return storage.resolve_original_photo_path("toto")
Esempio n. 6
0
            def topic(self, callback):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.get_crypto(IMAGE_URL % '9999', callback=callback)
Esempio n. 7
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.exists(IMAGE_URL % '9999', callback)
Esempio n. 8
0
            def topic(self, callback):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.get_detector_data(IMAGE_URL % '9999', callback=callback)
Esempio n. 9
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            return storage.resolve_original_photo_path("toto")
Esempio n. 10
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                return storage.get_detector_data(IMAGE_URL % '9999')
Esempio n. 11
0
        def topic(self):
            self.conn = S3Connection()
            bucket = self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket, STORAGE_AWS_STORAGE_ROOT_PATH="tata")
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))

            return storage.normalize_path("toto")
Esempio n. 12
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('')))
                storage.put(IMAGE_URL % '9999', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '9999')
Esempio n. 13
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, TC_AWS_STORAGE_ROOT_PATH='tata')
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            return storage._normalize_path('toto')
Esempio n. 14
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '3', IMAGE_BYTES)
            return storage.exists(IMAGE_URL % '3')
Esempio n. 15
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket, STORAGE_AWS_STORAGE_ROOT_PATH='tata')
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))

            return storage.normalize_path('toto')
Esempio n. 16
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            thumborId = IMAGE_URL % '1'
            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(thumborId, IMAGE_BYTES)
            storage.get(thumborId, callback=callback)
Esempio n. 17
0
        def topic(self):
            self.conn = S3Connection()
            bucket = self.conn.create_bucket(s3_bucket)

            thumborId = IMAGE_URL % '1'
            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            store = storage.put(thumborId, IMAGE_BYTES)
            k = Key(bucket)
            k.key = thumborId
            result = k.get_contents_as_string()
            return (store, result)
Esempio n. 18
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '5', IMAGE_BYTES)
            storage.remove(IMAGE_URL % '5')
            time.sleep(1)
            created = storage.exists(IMAGE_URL % '5')
            time.sleep(1)
            storage.put(IMAGE_URL % '5', IMAGE_BYTES)
            return storage.exists(IMAGE_URL % '5') != created
Esempio n. 19
0
            def topic(self, callback):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket, STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.put(IMAGE_URL % '6', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '6')
                storage.get_crypto(IMAGE_URL % '6', callback=callback)
Esempio n. 20
0
        def topic(self):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
            storage.put(IMAGE_URL % "5", IMAGE_BYTES)
            storage.remove(IMAGE_URL % "5")
            time.sleep(1)
            created = storage.exists(IMAGE_URL % "5")
            time.sleep(1)
            storage.put(IMAGE_URL % "5", IMAGE_BYTES)
            return storage.exists(IMAGE_URL % "5") != created
Esempio n. 21
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '4', IMAGE_BYTES)   # 1: we put the image

            def check_created(created):
                expect(created).to_equal(True) # 2.1: assertion...

                def once_removed(rm):
                    storage.exists(IMAGE_URL % '4', callback=callback) #4: we check if the image exists

                storage.remove(IMAGE_URL % '4', callback=once_removed) # 3: we delete it

            storage.exists(IMAGE_URL % '4', callback=check_created) # 2: we check it exists
Esempio n. 22
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '4', IMAGE_BYTES)  # 1: we put the image
            storage.remove(IMAGE_URL % '4')  # 2: we delete it
            storage.exists(IMAGE_URL % '4',
                           callback=callback)  # 3: we check it exists
Esempio n. 23
0
            def topic(self, callback):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.put(IMAGE_URL % '7', IMAGE_BYTES)
                storage.put_detector_data(IMAGE_URL % '7', 'some-data')
                storage.get_detector_data(IMAGE_URL % '7', callback=callback)
Esempio n. 24
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.put(IMAGE_URL % '7', IMAGE_BYTES)
                storage.put_detector_data(IMAGE_URL % '7', 'some-data')
                return storage.get_detector_data(IMAGE_URL % '7')
Esempio n. 25
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
                storage.put(IMAGE_URL % '9998', IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % '9998')
                return storage.get_crypto(IMAGE_URL % '9998')
Esempio n. 26
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '4', IMAGE_BYTES)   # 1: we put the image
            storage.remove(IMAGE_URL % '4') # 2: we delete it
            storage.exists(IMAGE_URL % '4', callback=callback) # 3: we check it exists
Esempio n. 27
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(
                Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '5', IMAGE_BYTES)  # 1: we put the image

            def check_created(created):
                expect(created).to_equal(True)  # 2.1: assertion...

                def once_removed(rm):
                    def check_created_2(exists):
                        expect(exists).to_equal(True)  # 4.1: assertion...

                        storage.put(IMAGE_URL % '5')  # 5: we re-put it
                        storage.exists(IMAGE_URL % '5', callback=callback
                                       )  #6: we check its existance again

                    storage.exists(IMAGE_URL % '5', callback=check_created_2
                                   )  #4: we check if the image exists

                storage.remove(IMAGE_URL % '5',
                               callback=once_removed)  # 3: we delete it

            storage.exists(IMAGE_URL % '5',
                           callback=check_created)  # 2: we check it exists
Esempio n. 28
0
        def topic(self, callback):
            self.conn = S3Connection()
            self.conn.create_bucket(s3_bucket)

            config = Config(TC_AWS_STORAGE_BUCKET=s3_bucket)
            storage = Storage(Context(config=config, server=get_server('ACME-SEC')))
            storage.put(IMAGE_URL % '3', IMAGE_BYTES)
            storage.exists(IMAGE_URL % '3', callback=callback)
Esempio n. 29
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
                storage.put(IMAGE_URL % "9998", IMAGE_BYTES)
                storage.put_crypto(IMAGE_URL % "9998")
                return storage.get_crypto(IMAGE_URL % "9998")
Esempio n. 30
0
            def topic(self):
                self.conn = S3Connection()
                self.conn.create_bucket(s3_bucket)

                config = Config(STORAGE_BUCKET=s3_bucket)
                storage = Storage(Context(config=config, server=get_server("ACME-SEC")))
                storage.put(IMAGE_URL % "7", IMAGE_BYTES)
                storage.put_detector_data(IMAGE_URL % "7", "some-data")
                return storage.get_detector_data(IMAGE_URL % "7")
Esempio n. 31
0
 def topic(self):
     config = Config(TC_AWS_STORAGE_ROOT_PATH='')
     return Storage(Context(config=config))
Esempio n. 32
0
 def topic(self):
     config = Config(TC_AWS_STORAGE_ROOT_PATH='',
                     TC_AWS_ROOT_IMAGE_NAME='root_image')
     return Storage(Context(config=config))
Esempio n. 33
0
 def topic(self):
     config = Config(AUTO_WEBP=True)
     context = Context(config=config)
     return Storage(context)
Esempio n. 34
0
 def topic(self):
     config = Config(AUTO_WEBP=False)
     context = Context(config=config)
     context.request = RequestParameters(accepts_webp=True)
     return Storage(context)
Esempio n. 35
0
 def topic(self):
     return Storage(
         Context(config=Config(STORAGE_EXPIRATION_SECONDS=0)))