当前位置: 首页>>代码示例>>Python>>正文


Python Config.FILE_STORAGE_ROOT_PATH方法代码示例

本文整理汇总了Python中thumbor.config.Config.FILE_STORAGE_ROOT_PATH方法的典型用法代码示例。如果您正苦于以下问题:Python Config.FILE_STORAGE_ROOT_PATH方法的具体用法?Python Config.FILE_STORAGE_ROOT_PATH怎么用?Python Config.FILE_STORAGE_ROOT_PATH使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在thumbor.config.Config的用法示例。


在下文中一共展示了Config.FILE_STORAGE_ROOT_PATH方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get_context

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_context(self):
        cfg = Config(SECURITY_KEY='ACME-SEC')
        cfg.LOADER = "thumbor.loaders.http_loader"
        cfg.STORAGE = "thumbor.storages.file_storage"
        cfg.FILE_STORAGE_ROOT_PATH = self.root_path

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', None)
        server.security_key = 'ACME-SEC'
        return Context(server, cfg, importer)
开发者ID:scorphus,项目名称:thumbor,代码行数:13,代码来源:test_base_handler.py

示例2: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        cfg = Config()
        cfg.ENABLE_ORIGINAL_PHOTO_UPLOAD = True
        cfg.ORIGINAL_PHOTO_STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = storage_path
        cfg.ALLOW_ORIGINAL_PHOTO_DELETION = False

        importer = Importer(cfg)
        importer.import_modules()
        ctx = Context(None, cfg, importer)
        application = ThumborServiceApp(ctx)
        return application
开发者ID:diogomonica,项目名称:thumbor,代码行数:14,代码来源:upload_vows.py

示例3: get_context

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_context(self):
        cfg = Config(SECURITY_KEY="ACME-SEC")
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = self.loader_path
        cfg.STORAGE = "thumbor.storages.file_storage"
        cfg.FILE_STORAGE_ROOT_PATH = self.root_path

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, "localhost", "thumbor.conf", None, "info", None)
        server.security_key = "ACME-SEC"
        return Context(server, cfg, importer)
开发者ID:my-forks,项目名称:thumbor,代码行数:14,代码来源:test_base_handler.py

示例4: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        cfg = Config()
        cfg.UPLOAD_ENABLED = True
        cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
        cfg.UPLOAD_DELETE_ALLOWED = False

        importer = Importer(cfg)
        importer.import_modules()
        ctx = Context(None, cfg, importer)
        application = ThumborServiceApp(ctx)
        return application
开发者ID:riseofthetigers,项目名称:thumbor,代码行数:14,代码来源:upload_vows.py

示例5: get_context

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_context(self):
        file_storage_root_path = '/tmp/thumbor/storage'
        if exists(file_storage_root_path):
            rmtree(file_storage_root_path)

        cfg = Config()
        cfg.USE_BLACKLIST = True
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = abspath(join(dirname(__file__), '../fixtures/images/'))
        cfg.STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
        importer = Importer(cfg)
        importer.import_modules()
        return Context(None, cfg, importer)
开发者ID:GDxU,项目名称:thumbor,代码行数:16,代码来源:test_blacklist.py

示例6: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        cfg = Config()
        cfg.UPLOAD_ENABLED = True
        cfg.UPLOAD_PUT_ALLOWED = True
        cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = storage_path
        cfg.MIN_WIDTH = 40
        cfg.MIN_HEIGHT = 40

        importer = Importer(cfg)
        importer.import_modules()
        ctx = Context(None, cfg, importer)
        application = ThumborServiceApp(ctx)
        return application
开发者ID:bguided,项目名称:thumbor,代码行数:16,代码来源:upload_vows.py

示例7: get_context

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_context(self):
        self.default_filename = 'image'

        cfg = Config()
        cfg.UPLOAD_ENABLED = True
        cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = self.root_path
        cfg.UPLOAD_DELETE_ALLOWED = False
        cfg.UPLOAD_PUT_ALLOWED = False
        cfg.UPLOAD_DEFAULT_FILENAME = self.default_filename

        importer = Importer(cfg)
        importer.import_modules()

        return Context(None, cfg, importer)
开发者ID:caeugusmao,项目名称:thumbor,代码行数:17,代码来源:test_upload_api.py

示例8: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        cfg = Config(SECURITY_KEY='ACME-SEC')
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = storage_path
        cfg.STORAGE = "thumbor.storages.file_storage"
        cfg.FILE_STORAGE_ROOT_PATH = FILE_STORAGE_ROOT_PATH
        if exists(FILE_STORAGE_ROOT_PATH):
            rmtree(FILE_STORAGE_ROOT_PATH)

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', None)
        server.security_key = 'ACME-SEC'
        ctx = Context(server, cfg, importer)
        application = ThumborServiceApp(ctx)

        return application
开发者ID:abhishekgodhani,项目名称:thumbor,代码行数:19,代码来源:handler_images_vows.py

示例9: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        self.default_filename = "image"

        cfg = Config()
        cfg.UPLOAD_ENABLED = True
        cfg.UPLOAD_PHOTO_STORAGE = "thumbor.storages.file_storage"
        cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
        cfg.UPLOAD_DELETE_ALLOWED = True
        cfg.UPLOAD_PUT_ALLOWED = False
        cfg.UPLOAD_DEFAULT_FILENAME = self.default_filename

        importer = Importer(cfg)
        importer.import_modules()

        ctx = Context(None, cfg, importer)
        application = ThumborServiceApp(ctx)
        return application
开发者ID:CameronNemo,项目名称:thumbor,代码行数:19,代码来源:upload_api_vows.py

示例10: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        self.default_filename = 'image'

        cfg = Config()
        cfg.UPLOAD_ENABLED = True
        cfg.UPLOAD_PUT_ALLOWED = True
        cfg.UPLOAD_PHOTO_STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path
        cfg.UPLOAD_DEFAULT_FILENAME = self.default_filename
        cfg.MIN_WIDTH = 40
        cfg.MIN_HEIGHT = 40
        cfg.UPLOAD_MAX_SIZE = 72000

        importer = Importer(cfg)
        importer.import_modules()
        ctx = Context(None, cfg, importer)
        application = ThumborServiceApp(ctx)
        return application
开发者ID:wking,项目名称:thumbor,代码行数:20,代码来源:upload_api_vows.py

示例11: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        cfg = Config(SECURITY_KEY='ACME-SEC')
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = storage_path
        cfg.ALLOW_UNSAFE_URL = False
        cfg.ALLOW_OLD_URLS = True
        cfg.STORAGE="thumbor.storages.file_storage"
        cfg.FILE_STORAGE_ROOT_PATH=storage_path
        cfg.STORES_CRYPTO_KEY_FOR_EACH_IMAGE=True

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8891, 'localhost', 'thumbor.conf', None, 'info', None)
        server.security_key = 'ACME-SEC'
        ctx = Context(server, cfg, importer)
        application = ThumborServiceApp(ctx)

        return application
开发者ID:bguided,项目名称:thumbor,代码行数:20,代码来源:handler_images_vows.py

示例12: get_app

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_app(self):
        file_storage_root_path = '/tmp/thumbor-vows/storage'
        if exists(file_storage_root_path):
            rmtree(file_storage_root_path)

        cfg = Config()
        cfg.USE_BLACKLIST = True
        cfg.LOADER = "thumbor.loaders.file_loader"
        cfg.FILE_LOADER_ROOT_PATH = abspath(join(dirname(__file__), 'fixtures/'))
        cfg.STORAGE = 'thumbor.storages.file_storage'
        cfg.FILE_STORAGE_ROOT_PATH = file_storage_root_path

        importer = Importer(cfg)
        importer.import_modules()

        server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'debug', None)
        ctx = Context(server, cfg, importer)
        application = ThumborServiceApp(ctx)
        return application
开发者ID:rdkls,项目名称:thumbor,代码行数:21,代码来源:blacklist_vows.py

示例13: get_context

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import FILE_STORAGE_ROOT_PATH [as 别名]
    def get_context(self):
        cfg = Config(SECURITY_KEY='ACME-SEC')
        cfg.LOADER = "tests.stub_file_loader"
        cfg.STORAGE = "thumbor.storages.file_storage"
        cfg.FILE_STORAGE_ROOT_PATH = self.root_path
        cfg.QUALITY = 'keep'
        cfg.SVG_DPI = 200

        self.image = 'http://test.domain/image.jpg'
        self.quoted_image = quote(self.image, safe='')
        self.transform = '400x400/smart'
        self.signature = UrlSigner(security_key="ACME-SEC").signature('%s/%s' % (self.transform, self.quoted_image))
        self.signed_prefix = "/%s/%s" % (self.signature, self.transform)
        self.full_image = "/%s/%s/%s" % (self.signature, self.transform, self.quoted_image)

        importer = Importer(cfg)
        importer.import_modules()
        server = ServerParameters(8889, 'localhost', 'thumbor.conf', None, 'info', 'thumbor_flexible_validation.app.ThumborServiceProxy')
        server.security_key = 'ACME-SEC'
        return Context(server, cfg, importer)
开发者ID:mashable,项目名称:thumbor_flexible_validation,代码行数:22,代码来源:test_app.py


注:本文中的thumbor.config.Config.FILE_STORAGE_ROOT_PATH方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。