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


Python Config.define方法代码示例

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


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

示例1:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

# Licensed under the MIT license: 
# http://www.opensource.org/licenses/mit-license

# HBASE STORAGE OPTIONS
from thumbor.config import Config
Config.define('HBASE_STORAGE_SERVER_HOST', 'localhost','Thrift Hbase interface Host for Storage', 'HBase Storage')
Config.define('HBASE_STORAGE_SERVER_PORT', 9090, 'Thrift Hbase interface Port for Storage', 'HBase Storage')
Config.define('HBASE_STORAGE_TABLE', 'thumbor', 'Thrift Hbase Table for Storage', 'HBase Storage')
Config.define('HBASE_STORAGE_FAMILY', 'images', 'Thrift Hbase column family for Storage', 'HBase Storage')

__version__ = "0.15"
开发者ID:heynemann,项目名称:thumbor_hbase,代码行数:19,代码来源:__init__.py

示例2:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

import os

_well_known_paths = [
    "/usr/share/color/icc"
]

_default_paths = [path for path in _well_known_paths if os.path.exists(path)]

# ICC options
from thumbor.config import Config
Config.define('ICC_PATH', _default_paths, 'An array of path to directories containing ICC profiles.', 'Color management')
Config.define('ICC_DEFAULT_PROFILE', 'sRGB', 'Name of the default ICC profile applied of none is specified.', 'Color management')
开发者ID:znerol,项目名称:thumbor-icc,代码行数:17,代码来源:__init__.py

示例3:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8
from thumbor.config import Config

Config.define(
    "THUMBOR_LOGDRAIN_METRICS_TIMINGS_MAPPING", {}, "Mapping for exposing Metrics via Heroku Logdrain", "Metrics"
)
Config.define(
    "THUMBOR_LOGDRAIN_METRICS_THRESHOLD",
    1,
    "Threshold for how many metrics should be collected before printing it out",
    "Metrics",
)
开发者ID:Jimdo,项目名称:thumbor-logdrain-metrics,代码行数:14,代码来源:__init__.py

示例4: Copyright

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8

# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.

from thumbor.config import Config

Config.define('TC_AWS_REGION', 'eu-west-1', 'S3 region', 'S3')
Config.define('TC_AWS_STORAGE_BUCKET', None, 'S3 bucket for Storage', 'S3')
Config.define('TC_AWS_STORAGE_ROOT_PATH', '', 'S3 path prefix for Storage bucket', 'S3')
Config.define('TC_AWS_LOADER_BUCKET', None, 'S3 bucket for loader', 'S3')
Config.define('TC_AWS_LOADER_ROOT_PATH', '', 'S3 path prefix for Loader bucket', 'S3')
Config.define('TC_AWS_RESULT_STORAGE_BUCKET', None, 'S3 bucket for result Storage', 'S3')
Config.define('TC_AWS_RESULT_STORAGE_ROOT_PATH', '', 'S3 path prefix for Result storage bucket', 'S3')
Config.define('TC_AWS_STORAGE_SSE', False, 'S3 encryption', 'S3')
Config.define('TC_AWS_STORAGE_RRS', False, 'S3 redundancy', 'S3')
Config.define('TC_AWS_ENABLE_HTTP_LOADER', False, 'Enable HTTP Loader as well?', 'S3')
Config.define('TC_AWS_ALLOWED_BUCKETS', False, 'List of allowed buckets to be requested', 'S3')
Config.define('TC_AWS_STORE_METADATA', False, 'S3 store result with metadata', 'S3')
Config.define('TC_AWS_ENDPOINT', None, 'Custom AWS API endpoint', 'S3')
Config.define('TC_AWS_MAX_RETRY', 0, 'Max retries for get image from S3 bucket', 'S3')
Config.define('TC_AWS_RANDOMIZE_KEYS', False, 'Should S3 keys be randomized? Defaults to False for BC, for performance, should be set to True', 'S3')
Config.define('TC_AWS_ROOT_IMAGE_NAME', '', 'When resizing a URL that ends in a slash, what should the corresponding cache key be?', 'S3')
开发者ID:thumbor-community,项目名称:aws,代码行数:26,代码来源:__init__.py

示例5: Copyright

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2012 David Mann [email protected]

# HBASE STORAGE OPTIONS
try:
    from thumbor.config import Config
    Config.define('RACKSPACE_PYRAX_CFG', '~/.pyrax.cfg', 'Pyrax configuration file location', 'RESULT_STORAGE')
    Config.define('RACKSPACE_PYRAX_REGION', 'SYD', 'Whether to connect to the private rackspace network', 'RESULT_STORAGE')
    Config.define('RACKSPACE_PYRAX_PUBLIC', True, 'Whether to connect to the private rackspace network', 'RESULT_STORAGE')
    Config.define('RACKSPACE_RESULT_STORAGES_CONTAINER', 'thumbor-test', 'Rackspace cloudfiles container', 'RESULT_STORAGE')
    Config.define('RACKSPACE_RESULT_STORAGES_CONTAINER_ROOT', '', 'Root storage path', 'RESULT_STORAGE')
    Config.define('RACKSPACE_RESULT_STORAGE_EXPIRES', True, 'Whether to set expires headers on the cloudfiles objects', 'RESULT_STORAGE')
    
    Config.define('RACKSPACE_PYRAX_CFG', '~/.pyrax.cfg', 'Pyrax configuration file location', 'LOADER')
    Config.define('RACKSPACE_PYRAX_IDENTITY_TYPE', 'rackspace', 'Pyrax identity_type', 'LOADER')
    Config.define('RACKSPACE_PYRAX_REGION', 'SYD', 'Whether to connect to the private rackspace network', 'LOADER')
    Config.define('RACKSPACE_PYRAX_PUBLIC', True, 'Whether to connect to the private rackspace network', 'LOADER')
    Config.define('RACKSPACE_LOADER_CONTAINER', 'thumbor-test', 'Rackspace cloudfiles container', 'LOADER')
    Config.define('RACKSPACE_LOADER_CONTAINER_ROOT', '', 'Root storage path', 'LOADER')
except ImportError:
    #Thumbor isn't installed yet
    pass

__version__ = "0.4"
开发者ID:CodingNinja,项目名称:thumbor_rackspace,代码行数:33,代码来源:__init__.py

示例6:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8
from thumbor.config import Config
Config.define('STORAGE_BUCKET', 'thumbor-images','S3 bucket for Storage', 'S3')
Config.define('RESULT_STORAGE_BUCKET', 'thumbor-result', 'S3 bucket for result Storage', 'S3')
Config.define('S3_LOADER_BUCKET','thumbor-images','S3 bucket for loader', 'S3')
Config.define('RESULT_STORAGE_AWS_STORAGE_ROOT_PATH','', 'S3 path prefix', 'S3')
Config.define('STORAGE_EXPIRATION_SECONDS', 3600, 'S3 expiration', 'S3')
Config.define('S3_STORAGE_SSE', False, 'S3 encriptipon key', 'S3')
Config.define('S3_STORAGE_RRS', False, 'S3 redundency', 'S3')
Config.define('S3_ALLOWED_BUCKETS', False, 'List of allowed bucket to be requeted', 'S3')

Config.define('AWS_ACCESS_KEY', None, 'AWS Access key, if None use environment AWS_ACCESS_KEY_ID', 'AWS')
Config.define('AWS_SECRET_KEY', None, 'AWS Secret key, if None use environment AWS_SECRET_ACCESS_KEY', 'AWS')
Config.define('AWS_ROLE_BASED_CONNECTION', False, 'EC2 instance can use role that does not require AWS_ACCESS_KEY see http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-usingrole-ec2instance.html', 'AWS')
开发者ID:Bladrak,项目名称:aws,代码行数:16,代码来源:__init__.py

示例7:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

# Licensed under the MIT license: 
# http://www.opensource.org/licenses/mit-license

# HBASE STORAGE OPTIONS
from thumbor.config import Config
Config.define('MONGO_LOADER_CNX_STRING', 'localhost', "MongodDB connexion string", 'mongo_loader')
Config.define('MONGO_LOADER_SERVER_DB', 'thumbor', 'MongoDB database', 'mongo_loader')
Config.define('MONGO_LOADER_SERVER_COLLECTION', 'images', 'MongoDB Collection', 'mongo_loader')
Config.define('MONGO_LOADER_DOC_FIELD', 'content', 'MongoDB document field used for image content', 'mongo_loader')

__version__ = "0.2"
开发者ID:dhardy92,项目名称:thumbor_mongodb,代码行数:19,代码来源:__init__.py

示例8: Copyright

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8

# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.

from thumbor.config import Config

Config.define('TC_AWS_REGION',                    'eu-west-1', 'S3 region', 'S3')

Config.define('TC_AWS_STORAGE_BUCKET',             None,       'S3 bucket for Storage', 'S3')
Config.define('TC_AWS_STORAGE_ROOT_PATH',          '',         'S3 path prefix for Storage bucket', 'S3')

Config.define('TC_AWS_LOADER_BUCKET',              None,       'S3 bucket for loader', 'S3')
Config.define('TC_AWS_LOADER_ROOT_PATH',           '',         'S3 path prefix for Loader bucket', 'S3')

Config.define('TC_AWS_RESULT_STORAGE_BUCKET',      None,       'S3 bucket for result Storage', 'S3')
Config.define('TC_AWS_RESULT_STORAGE_ROOT_PATH',   '',         'S3 path prefix for Result storage bucket', 'S3')

Config.define('TC_AWS_STORAGE_SSE',                False,      'S3 encryption', 'S3')
Config.define('TC_AWS_STORAGE_RRS',                False,      'S3 redundancy', 'S3')

Config.define('TC_AWS_ENABLE_HTTP_LOADER',         False,      'Enable HTTP Loader as well?', 'S3')
Config.define('TC_AWS_ALLOWED_BUCKETS',            False,      'List of allowed buckets to be requested', 'S3')
Config.define('TC_AWS_STORE_METADATA',             False,      'S3 store result with metadata', 'S3')
Config.define('TC_AWS_STORE_SAFEURL',              True,      'S3 store images in folders named by safe code or unsafe', 'S3')

开发者ID:VladimirFilonov,项目名称:aws,代码行数:28,代码来源:__init__.py

示例9: access

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8

from thumbor.config import Config

Config.define('STORAGE_BUCKET',                         'thumbor-images',   'S3 bucket for Storage', 'S3')
Config.define('RESULT_STORAGE_BUCKET',                  'thumbor-result',   'S3 bucket for result Storage', 'S3')
Config.define('S3_LOADER_BUCKET',                       None,               'S3 bucket for loader', 'S3')

Config.define('S3_LOADER_ROOT_PATH',                    '',                 'S3 path prefix for Loader bucket', 'S3')
Config.define('STORAGE_AWS_STORAGE_ROOT_PATH',          '',                 'S3 path prefix for Storage bucket', 'S3')
Config.define('RESULT_STORAGE_AWS_STORAGE_ROOT_PATH',   '',                 'S3 path prefix for Result storage bucket', 'S3')

Config.define('STORAGE_EXPIRATION_SECONDS',             3600,               'S3 expiration', 'S3')

Config.define('S3_STORAGE_SSE',                         False,              'S3 encriptipon key', 'S3')
Config.define('S3_STORAGE_RRS',                         False,              'S3 redundency', 'S3')
Config.define('S3_ALLOWED_BUCKETS',                     False,              'List of allowed bucket to be requeted', 'S3')

Config.define('AWS_ACCESS_KEY',                         None,               'AWS Access key, if None use environment AWS_ACCESS_KEY_ID', 'AWS')
Config.define('AWS_SECRET_KEY',                         None,               'AWS Secret key, if None use environment AWS_SECRET_ACCESS_KEY', 'AWS')
Config.define('AWS_ROLE_BASED_CONNECTION',              False,              'EC2 instance can use role that does not require AWS_ACCESS_KEY see http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-usingrole-ec2instance.html', 'AWS')

Config.define('BOTO_CONFIG',                            None,               'Additional Boto options for configuring S3 access (see http://boto.readthedocs.org/en/latest/ref/s3.html?highlight=boto.s3.connection.s3connection#boto.s3.connection.S3Connection)')
开发者ID:andrew-a-dev,项目名称:aws,代码行数:25,代码来源:__init__.py

示例10:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8
from thumbor.config import Config

Config.define('LIBRATO_USER', None, 'Librato api username', 'Metrics')
Config.define('LIBRATO_TOKEN', None, 'Librato api token', 'Metrics')
Config.define('LIBRATO_NAME_PREFIX', 'thumbor', 'Librato metrics prefix', 'Metrics')
Config.define('LIBRATO_QUEUE_LENGTH', 1000, 'Librato autosubmit queue size', 'Metrics')
开发者ID:thumbor-community,项目名称:librato,代码行数:9,代码来源:__init__.py

示例11: optipng

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
from thumbor.config import Config

Config.define(
    'PNGCRUSH_PATH',
    '/usr/local/bin/pngcrush',
    'Path for the pngcrush binary',
    'Optimizers'
)

Config.define(
    'OPTIPNG_PATH',
    '/usr/bin/optipng',
    'Path for the optipng binary',
    'Optimizers'
)

Config.define(
    'OPTIPNG_LEVEL',
    5,
    'Optimization level for optipng (0-7)',
    'Optimizers'
)

Config.define(
    'JP2_QUALITY',
    '41',
    'Optimization level for jp2 optimizer',
    'Optimizers'
)

Config.define(
开发者ID:ksperis,项目名称:thumbor-plugins,代码行数:33,代码来源:__init__.py

示例12:

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license

# HBASE STORAGE OPTIONS
from thumbor.config import Config
Config.define('RIAK_STORAGE_BASEURL', 'http://localhost:8097/riak','HTTP Riak interface for Storage', 'Riak Storage')

__version__ = "0.2"
开发者ID:dhardy92,项目名称:thumbor_riak,代码行数:16,代码来源:__init__.py

示例13: Copyright

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
# coding: utf-8

# Copyright (c) 2015, thumbor-community
# Use of this source code is governed by the MIT license that can be
# found in the LICENSE file.

from thumbor.config import Config

Config.define('TC_AWS_REGION', 'eu-west-1', 'S3 region', 'S3')
Config.define('TC_AWS_STORAGE_BUCKET', None, 'S3 bucket for Storage', 'S3')
Config.define('TC_AWS_STORAGE_ROOT_PATH', '', 'S3 path prefix for Storage bucket', 'S3')
Config.define('TC_AWS_LOADER_BUCKET', None, 'S3 bucket for loader', 'S3')
Config.define('TC_AWS_LOADER_ROOT_PATH', '', 'S3 path prefix for Loader bucket', 'S3')
Config.define('TC_AWS_RESULT_STORAGE_BUCKET', None, 'S3 bucket for result Storage', 'S3')
Config.define('TC_AWS_RESULT_STORAGE_ROOT_PATH', '', 'S3 path prefix for Result storage bucket', 'S3')
Config.define('TC_AWS_STORAGE_SSE', False, 'S3 encryption', 'S3')
Config.define('TC_AWS_STORAGE_RRS', False, 'S3 redundancy', 'S3')
Config.define('TC_AWS_ENABLE_HTTP_LOADER', False, 'Enable HTTP Loader as well?', 'S3')
Config.define('TC_AWS_ALLOWED_BUCKETS', False, 'List of allowed buckets to be requested', 'S3')
Config.define('TC_AWS_STORE_METADATA', False, 'S3 store result with metadata', 'S3')
Config.define('TC_AWS_ENDPOINT', None, 'Custom AWS API endpoint', 'S3')
Config.define('TC_AWS_MAX_RETRY', 0, 'Max retries for get image from S3 bucket', 'S3')
开发者ID:aoqfonseca,项目名称:aws,代码行数:24,代码来源:__init__.py

示例14: Copyright

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2012 David Mann [email protected]

# HBASE STORAGE OPTIONS
from thumbor.config import Config
Config.define('RACKSPACE_PYRAX_CFG', '~/.pyrax.cfg', 'Pyrax configuration file location', 'RESULT_STORAGE')
Config.define('RACKSPACE_RESULT_STORAGES_CONTAINER', 'thumbor-test', 'Rackspace cloudfiles container', 'RESULT_STORAGE')
Config.define('RACKSPACE_RESULT_STORAGES_CONTAINER_ROOT', '/products/', 'Root storage path', 'RESULT_STORAGE')
Config.define('RACKSPACE_RESULT_STORAGE_EXPIRES', True, 'Whether to set expires headers on the cloudfiles objects', 'RESULT_STORAGE')
开发者ID:heynemann,项目名称:thumbor_rackspace,代码行数:18,代码来源:__init__.py

示例15: Copyright

# 需要导入模块: from thumbor.config import Config [as 别名]
# 或者: from thumbor.config.Config import define [as 别名]
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com [email protected]

__version__ = "0.1.0"

from thumbor.config import Config

Config.define(
    'PNGCRUSH_PATH',
    '/usr/local/bin/pngcrush',
    'Path for the pngcrush binary',
    'Optimizers'
)

Config.define(
    'OPTIPNG_PATH',
    '/usr/bin/optipng',
    'Path for the optipng binary',
    'Optimizers'
)

Config.define(
    'OPTIPNG_LEVEL',
    5,
    'Optimization level for optipng (0-7)',
    'Optimizers'
)
开发者ID:NextWebVentures,项目名称:thumbor-plugins,代码行数:33,代码来源:__init__.py


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