コード例 #1
0
 def topic(self):
     config = Config(
         AUTO_WEBP=False,
         RESULT_STORAGE_FILE_STORAGE_ROOT_PATH="/tmp/thumbor/result_storages%s" % (random.choice(['', '/'])))
     context = Context(config=config)
     context.request = RequestParameters(accepts_webp=False)
     return FileStorage(context)
コード例 #2
0
 def get_context(self):
     cfg = self.get_config()
     ctx = Context(None, cfg, None)
     ctx.request = self.get_request()
     self.context = ctx
     self.file_storage = FileStorage(self.context)
     return ctx
コード例 #3
0
 def get_context(self):
     ctx = super().get_context()
     cfg = self.get_config()
     ctx.config = cfg
     ctx.request = self.get_request()
     self.context = ctx
     self.file_storage = FileStorage(self.context)
     return ctx
コード例 #4
0
 def topic(self, callback):
     config = Config(RESULT_STORAGE_FILE_STORAGE_ROOT_PATH=STORAGE_PATH)
     context = Context(config=config)
     context.request = RequestParameters(url='image.jpg')
     fs = FileStorage(context)
     fs.get(callback=callback)