本文整理汇总了Python中thumbor.importer.Importer.filters方法的典型用法代码示例。如果您正苦于以下问题:Python Importer.filters方法的具体用法?Python Importer.filters怎么用?Python Importer.filters使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类thumbor.importer.Importer
的用法示例。
在下文中一共展示了Importer.filters方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_context
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def get_context():
conf = Config()
conf.ENGINE = "thumbor.engines.pil"
imp = Importer(conf)
imp.import_modules()
imp.filters = [Filter]
return Context(None, conf, imp)
示例2: topic
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def topic(self):
conf = Config()
conf.ENGINE = 'thumbor.engines.pil'
imp = Importer(conf)
imp.import_modules()
imp.filters = [Filter]
return Context(None, conf, imp)
示例3: setUp
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def setUp(self, *args, **kwargs):
super(FakeRotateEngineRotateFilterTestCase, self).setUp(*args, **kwargs)
conf = Config()
imp = Importer(conf)
imp.filters = [Filter]
self.context = Context(None, conf, imp)
self.context.request = RequestParameters()
示例4: topic
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def topic(self):
conf = Config()
imp = Importer(conf)
imp.filters = [Filter]
ctx = Context(None, conf, imp)
ctx.request = RequestParameters()
filter_instances = ctx.filters_factory.create_instances(ctx, "format(invalid)")
filter_instances[0].run()
示例5: topic
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def topic(self):
conf = Config()
imp = Importer(conf)
imp.filters = [Filter]
ctx = Context(None, conf, imp)
ctx.request = RequestParameters()
runner = ctx.filters_factory.create_instances(ctx, "format(invalid)")
filter_instances = runner.filter_instances[thumbor.filters.PHASE_POST_TRANSFORM]
filter_instances[0].run()
示例6: topic
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def topic(self):
conf = Config()
imp = Importer(conf)
imp.filters = [Filter]
ctx = Context(None, conf, imp)
ctx.request = RequestParameters()
runner = ctx.filters_factory.create_instances(ctx, "rotate(540)")
filter_instances = runner.filter_instances[thumbor.filters.PHASE_POST_TRANSFORM]
filter_instances[0].engine = RotateEngine()
filter_instances[0].run()
return filter_instances[0].engine.rotate_val
示例7: topic
# 需要导入模块: from thumbor.importer import Importer [as 别名]
# 或者: from thumbor.importer.Importer import filters [as 别名]
def topic(self):
conf = Config()
conf.ENGINE = 'thumbor.engines.pil'
imp = Importer(conf)
imp.import_modules()
imp.filters = [Filter]
ctx = Context(None, conf, imp)
for item in DATA:
ctx.modules.engine.image = ctx.modules.engine.gen_image(item[1],'#fff')
req = RequestParameters(fit_in=True,width=item[0][0],height=item[0][1])
ctx.request = req
filter_instances = ctx.filters_factory.create_instances(ctx, "fill(blue)")
filter_instances[0].run()
yield (filter_instances[0].engine.image.size,item[2])