示例#1
0
        def topic(self):
            conn = boto.connect_s3()
            bucket = conn.create_bucket(s3_bucket)

            k = Key(bucket)
            k.key = IMAGE_PATH
            k.set_contents_from_string(IMAGE_BYTES)

            conf = Config()
            conf.define('S3_LOADER_BUCKET', s3_bucket, '')
            conf.define('S3_LOADER_ROOT_PATH', 'root_path', '')

            return Context(config=conf)
示例#2
0
        def topic(self, callback):
            conn = boto.connect_s3()
            bucket = conn.create_bucket(s3_bucket)

            k = Key(bucket)
            k.key = '/'.join(['root_path', IMAGE_PATH])
            k.set_contents_from_string(IMAGE_BYTES)

            conf = Config()
            conf.define('TC_AWS_LOADER_BUCKET', s3_bucket, '')
            conf.define('TC_AWS_LOADER_ROOT_PATH', 'root_path', '')

            context = Context(config=conf)

            s3_loader.load(context, IMAGE_PATH, callback)
示例#3
0
# -*- coding: utf-8 -*-

# This file is part of splitsecond.
# https://github.com/globocom/splitsecond

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2015, Bernardo Heynemann <*****@*****.**>

import derpconf.config as config
from derpconf.config import Config

from splitsecond.version import __version__


Config.define('SPLITSECOND_LOG_CONFIG', None, 'Logging configuration as json', 'Logging')

Config.define(
    'SPLITSECOND_LOG_FORMAT', '%(asctime)s %(name)s:%(levelname)s %(message)s',
    'Log Format to be used by split second when writing log messages.', 'Logging')

Config.define(
    'SPLITSECOND_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
    'Date Format to be used by splitsecond when writing log messages.', 'Logging')

Config.define(
    'LOADER', 'splitsecond.loaders.http_loader', 'Class to load assets with.', 'Loader'
)

Config.define(
    'OPTIMIZERS', [], 'Optimizers to run on assets.', 'Optimizers'
示例#4
0
文件: config.py 项目: oesteve/thumbor
from os.path import expanduser, join
import tempfile

import derpconf.config as config
from derpconf.config import Config

from thumbor import __version__

try:
    basestring        # Python 2
except NameError:
    basestring = str  # Python 3

home = expanduser("~")

Config.define('THUMBOR_LOG_CONFIG', None, 'Logging configuration as json', 'Logging')
Config.define(
    'THUMBOR_LOG_FORMAT', '%(asctime)s %(name)s:%(levelname)s %(message)s',
    'Log Format to be used by thumbor when writing log messages.', 'Logging')

Config.define(
    'THUMBOR_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
    'Date Format to be used by thumbor when writing log messages.', 'Logging')

Config.define('MAX_WIDTH', 0, "Max width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MAX_HEIGHT', 0, "Max height in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MAX_PIXELS', 75e6, "Max pixel count for images read by thumbor", "Imaging")
Config.define('MIN_WIDTH', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_HEIGHT', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('ALLOWED_SOURCES', [], "Allowed domains for the http loader to download. These are regular expressions.", 'Imaging')
Config.define('QUALITY', 80, 'Quality index used for generated JPEG images', 'Imaging')
示例#5
0
# -*- 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) 2011 globo.com [email protected]

from os.path import join
import tempfile
import derpconf.config as config
from derpconf.config import Config


Config.define("MAX_WIDTH", 0, "Max width in pixels for images read or generated by thumbor", "Imaging")
Config.define("MAX_HEIGHT", 0, "Max height in pixels for images read or generated by thumbor", "Imaging")
Config.define("MIN_WIDTH", 1, "Min width in pixels for images read or generated by thumbor", "Imaging")
Config.define("MIN_HEIGHT", 1, "Min width in pixels for images read or generated by thumbor", "Imaging")
Config.define(
    "ALLOWED_SOURCES", [], "Allowed domains for the http loader to download. These are regular expressions.", "Imaging"
)
Config.define("QUALITY", 80, "Quality index used for generated JPEG images", "Imaging")
Config.define("MAX_AGE", 24 * 60 * 60, "Max AGE sent as a header for the image served by thumbor in seconds", "Imaging")
Config.define(
    "MAX_AGE_TEMP_IMAGE",
    0,
    "Indicates the Max AGE header in seconds for temporary images (images that haven't been detected yet)",
    "Imaging",
)
Config.define(
示例#6
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config  # NOQA


Config.define('WORKER_SLEEP_TIME', 10, 'Main loop sleep time', 'Worker')
Config.define('ZOMBIE_WORKER_TIME', 200,
              'Time to remove a Worker from API List (must be greater than WORKER_SLEEP_TIME + Validation time)', 'API')

Config.define('CONNECT_TIMEOUT_IN_SECONDS', 20, 'Number of seconds a connection can take.', 'Worker')
Config.define('REQUEST_TIMEOUT_IN_SECONDS', 60, 'Number of seconds a request can take.', 'Worker')

Config.define('HOLMES_API_URL', 'http://localhost:2368', 'URL that Worker will communicate with API', 'Worker')

Config.define('LOG_LEVEL', 'ERROR', 'Default log level', 'Logging')
Config.define('LOG_FORMAT', '%(asctime)s:%(levelname)s %(module)s - %(message)s',
              'Log Format to be used when writing log messages', 'Logging')
Config.define('LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
              'Date Format to be used when writing log messages.', 'Logging')

Config.define('FACTERS', [], 'List of classes to get facts about a website', 'Review')
Config.define('VALIDATORS', [], 'List of classes to validate a website', 'Review')
Config.define('REVIEW_EXPIRATION_IN_SECONDS', 6 * 60 * 60, 'Number of seconds that a review expires in.', 'Review')

Config.define('MAX_ENQUEUE_BUFFER_LENGTH', 1000,
              'Number of urls to enqueue before submitting to the /pages route', 'Validators')

# Reference data retrieved from HTTP Archive in 06-jan-2014
Config.define('MAX_IMG_REQUESTS_PER_PAGE', 40,
              'Maximum number of images per page', 'Image Request Validator')
示例#7
0
extension = Extension('tc_shortener')

# Register the required modules
extension.add_module(
    config_key='SHORTENER_GENERATOR',
    class_name='Generator',
    multiple=False
)

extension.add_module(
    config_key='SHORTENER_STORAGE',
    class_name='Storage',
    multiple=False
)

Config.define('SHORTENER_GENERATOR', 'tc_shortener.generators.short_generator',  'Shortened URL generator class.', 'Shortener')
Config.define('SHORTENER_STORAGE',   'tc_shortener.storages.redis_storage',      'Shortened URL storage.',         'Shortener')

Config.define('SHORTENER_GENERATOR_PRESERVE_NAME', True, 'Should the URL generator preserve the image name in the URL?', 'Shortener')

Config.define('SHORTENER_REDIS_STORAGE_SERVER_HOST',     'localhost', 'Redis hostname.',           'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_PORT',     6379,        'Redis port.',               'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_PASSWORD', None,        'Redis password.',           'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_DB',       0,           'Redis db name (optional).', 'Shortener')

# Register the route
extension.add_handler(UrlShortenerHandler.regex(), UrlShortenerHandler)

Extensions.register(extension)
示例#8
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config  # NOQA

Config.define(
    'STORAGE',
    'gaas.storage.sqlalchemy.SqlAlchemyStorage',
    'Storage to be used when saving information about repositories or users',
    'Storage'
)

Config.define('MONGO_DATABASES', {
    'default': {
        'host': 'localhost',
        'port': 4445,
        'database': 'gaas',
    }
}, 'MongoDB Database connection.', 'Database')

Config.define(
    'GIT_ROOT',
    '/tmp/gaas/gitroot',
    'Root folder to store git repositories.',
    'Git'
)
示例#9
0
from tc_core import Extension, Extensions
from tc_shortener.handlers.shortener import UrlShortenerHandler

extension = Extension('tc_shortener')

# Register the required modules
extension.add_module(config_key='SHORTENER_GENERATOR',
                     class_name='Generator',
                     multiple=False)

extension.add_module(config_key='SHORTENER_STORAGE',
                     class_name='Storage',
                     multiple=False)

Config.define('SHORTENER_GENERATOR', 'tc_shortener.generators.short_generator',
              'Shortened URL generator class.', 'Shortener')
Config.define('SHORTENER_STORAGE', 'tc_shortener.storages.redis_storage',
              'Shortened URL storage.', 'Shortener')

Config.define('SHORTENER_GENERATOR_PRESERVE_NAME', True,
              'Should the URL generator preserve the image name in the URL?',
              'Shortener')

Config.define('SHORTENER_REDIS_STORAGE_SERVER_HOST', 'localhost',
              'Redis hostname.', 'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_PORT', 6379, 'Redis port.',
              'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_PASSWORD', None,
              'Redis password.', 'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_DB', 0,
              'Redis db name (optional).', 'Shortener')
示例#10
0
# -*- 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) 2011 globo.com [email protected]

from os.path import join
import tempfile
import derpconf.config as config
from derpconf.config import Config


Config.define('MAX_WIDTH', 0, "Max width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MAX_HEIGHT', 0, "Max height in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_WIDTH', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_HEIGHT', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('ALLOWED_SOURCES', [], "Allowed domains for the http loader to download. These are regular expressions.", 'Imaging')
Config.define('QUALITY', 80, 'Quality index used for generated JPEG images', 'Imaging')
Config.define('MAX_AGE', 24 * 60 * 60, 'Max AGE sent as a header for the image served by thumbor in seconds', 'Imaging')
Config.define('MAX_AGE_TEMP_IMAGE', 0, "Indicates the Max AGE header in seconds for temporary images (images that haven't been detected yet)", 'Imaging')
Config.define('RESPECT_ORIENTATION', False, 'Indicates whether thumbor should rotate images that have an Orientation EXIF header', 'Imaging')

Config.define('LOADER',  'thumbor.loaders.http_loader', 'The loader thumbor should use to load the original image. This must be the full name of a python module (python must be able to import it)', 'Extensibility')
Config.define('STORAGE', 'thumbor.storages.file_storage', 'The file storage thumbor should use to store original images. This must be the full name of a python module (python must be able to import it)', 'Extensibility')
Config.define('RESULT_STORAGE', None, 'The result storage thumbor should use to store generated images. This must be the full name of a python module (python must be able to import it)', 'Extensibility')
Config.define('ENGINE', 'thumbor.engines.pil', 'The imaging engine thumbor should use to perform image operations. This must be the full name of a python module (python must be able to import it)', 'Extensibility')

Config.define('SECURITY_KEY', 'MY_SECURE_KEY', 'The security key thumbor uses to sign image URLs', 'Security')
示例#11
0
文件: config.py 项目: rbrezu/dna_api
from os.path import expanduser

import derpconf.config as config
from derpconf.config import Config

home = expanduser("~")

Config.allow_environment_variables()

Config.define('SERVER_URL', 'http://dna.whiteosftware.ro', 'SERVER_URL',
              'Server url')

Config.define('SERVER_LOG_CONFIG', None, 'Logging configuration as json',
              'Logging')
Config.define('SERVER_LOG_FORMAT',
              '%(asctime)s %(name)s:%(levelname)s %(message)s',
              'Log Format to be used by SERVER when writing log messages.',
              'Logging')

Config.define('SERVER_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
              'Date Format to be used by SERVER when writing log messages.',
              'Logging')

# DATABASE
Config.define('MONGODB_URL', 'mongodb://localhost:27017/', 'MONGODB_URL',
              'mongodb url')

Config.define('MONGODB_DATABASE', 'dnaAPI', 'mongodb database',
              'mongodb database')

# MODELS OPTIONS
示例#12
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from os.path import abspath, dirname, join

web_root_path = abspath(
    join(dirname(__file__), '..', '..', 'shamester-web', 'dist'))

from derpconf.config import Config

Config.define('MONGOHOST', 'localhost', "Database configuration", "Database")
Config.define('MONGOPORT', 6680, "Database configuration", "Database")
Config.define('MONGODATABASE', 'shamester', "Database configuration",
              "Database")

Config.define('REDISHOST', 'localhost', "Database configuration", "Database")
Config.define('REDISPORT', 7777, "Database configuration", "Database")

Config.define('WEB_ROOT_PATH', web_root_path, "Root path for the web app.",
              "Web")
Config.define('ENVIRONMENT', 'local',
              "Defines the javascript include to be used.", "Web")
Config.define('API_URL', 'http://localhost:3000/',
              "Defines the base URL for the API.", "Web")
示例#13
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config  # NOQA

Config.define('OAUTH_LATENCY', 100, 'Login route latency in MS. 0 to none.',
              'General')
Config.define('TOKEN_LATENCY', 100, 'Token route latency in MS. 0 to none.',
              'General')
Config.define('USERDATA_LATENCY', 100,
              'User Data route latency in MS. 0 to none.', 'General')


def generate_config():
    print Config.get_config_text()


if __name__ == '__main__':
    generate_config()
示例#14
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config

Config.define('TESTCONF', 'test-configuration',
              "Test configuration in sandbox", 'Section')
示例#15
0
# 3rd Party
from derpconf.config import Config

Config.allow_environment_variables()

Config.define("ENV", "development", "Environment application is running in",
              "General")
Config.define(
    "SECRET_KEY",
    "OTNDN0VCRDAtRTMyMS00NUM0LUFFQUYtNEI4QUE4RkFCRjUzCg==",
    "Secret key to use in flask.",
    "General",
)

Config.define("REDIS_URL", "redis://localhost:10100/0",
              "Redis connection string", "Redis")

Config.define(
    "WORKER_SLEEP_TIME_MS",
    10,
    "Number of milliseconds that fastlane must sleep before getting the next job",
    "Worker",
)

Config.define(
    "HARD_EXECUTION_TIMEOUT_SECONDS",
    30 * 60,
    "Number of seconds that fastlane must wait before killing an execution",
    "Worker",
)
示例#16
0
from os import path

from derpconf.config import Config as c, verify_config, generate_config

# Core options

c.define("BACKEND", "github", "Specify issue-tracking backend")

c.define("DB", "githubsurvivor", "Mongo database to use as local datastore")

c.define(
    "FLASK_DEBUG",
    False,
    "Whether to display the interactive debugger on error. Don't enable this in publicly-accessible environments.",
)

c.define("FLASK_SETTINGS", {"host": "127.0.0.1", "port": 5000}, "Options to pass to Flask initialiser")

# GitHub options

c.define("GITHUB_REPO", None, "Specify the GitHub repo you want to report on", "GitHub")

c.define(
    "GITHUB_OAUTH_TOKEN",
    None,
    "OAuth token for accessing your repo. See https://help.github.com/articles/creating-an-oauth-token-for-command-line-use",
    "GitHub",
)

# JIRA options
示例#17
0
import os
from derpconf.config import Config, verify_config

Config.define("WORKER_SLEEP_TIME", 60, "Main loop sleep time", "Worker")

Config.define("LOG_LEVEL", "ERROR", "Default log level", "Logging")
Config.define("LOG_FORMAT",
              "%(asctime)s:%(levelname)s %(module)s - %(message)s",
              "Log Format to be used when writing log messages", "Logging")
Config.define("LOG_DATE_FORMAT", "%Y-%m-%d %H:%M:%S",
              "Date Format to be used when writing log messages.", "Logging")

Config.define("VALIDATORS", set(), "List of classes to validate a website",
              "Validators")
Config.define("TIMEOUT", 1, "Http Timeout (in seconds)", "Validators")

Config.define("MAX_PAGE_SIZE", 100, "Validates the html file size (in KB)",
              "Validators")


def verify_and_load(config_file):
    verify_config(config_file)
    return Config.load(config_file)
示例#18
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config, generate_config

MINUTES = 60

Config.define('HEALTHCHECK_TEXT', 'WORKING', 'Cyclops has a /healthcheck route. This allows load balancers to ping it to see if the process is still alive. This option defines the text that the /healthcheck route prints.', 'General')
Config.define('SENTRY_BASE_URL', 'localhost:9000', 'Sentry server name. This is the base URL that Cyclops will use to send requests to sentry.', 'General')
Config.define('UPDATE_PERIOD', 2 * MINUTES, "Cyclops keeps sentry's projects public and security keys in memory. This allows a very fast validation as to whether each request is valid. This configuration defines the interval in seconds that Cyclops will update the keys.", 'General')
Config.define('PROCESS_NEWER_MESSAGES_FIRST', True, "This configuration tells cyclops to process newly arrived error reports first. This is very useful to avoid that error bursts stop you from seeing new errors.", 'General')

Config.define(
    'STORAGE',
    'cyclops.storage.memory',
    'The storage class used in Cyclops. Storage classes are what define how received requests will be treated *before* sending to sentry. Inherits from cyclops.storage.base.Storage. ' +
    'Built-ins: "cyclops.storage.memory" and "cyclops.storage.redis."',
    'General'
)

Config.define('MAX_DUMP_INTERVAL', 1000, 'Cyclops will try to send the errors it receives to sentry as fast as possible. This is done using a percentile average of 90% of the last sentry requests time. If those requests were serviced in 30ms average, then cyclops will keep sending requests every 30ms. This setting specify a maximum interval in miliseconds to send requests to sentry.', 'Performance')
Config.define('MAX_REQUESTS_TO_AVERAGE', 5000, 'In order to calculate the average requests, Cyclops keeps track of the times of the last requests sent to sentry. This setting specifies the maximum number of requests to average.', 'Performance')

Config.define('MYSQL_HOST', 'localhost', 'Host of your sentry installation MySQL database.', 'Database')
Config.define('MYSQL_PORT', 3306, 'Port of your sentry installation MySQL database.', 'Database')
Config.define('MYSQL_DB', 'sentry', 'Database of your sentry installation MySQL database.', 'Database')
Config.define('MYSQL_USER', 'root', 'User of your sentry installation MySQL database.', 'Database')
Config.define('MYSQL_PASS', '', 'Password of your sentry installation MySQL database.', 'Database')

Config.define('URL_CACHE_EXPIRATION', 1, 'The amount of seconds to cache a given URL of error. This is meant to be a way to avoid flooding your sentry farm with repeated errors. Set to 0 if you don\'t want to cache any errors.', 'Cache')
Config.define('MAX_CACHE_USES', 10, 'Number of requests to accept in the specified expiration of the cache per url.', 'Cache')
示例#19
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

import os
from derpconf.config import Config, generate_config

STATIC_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'static'))

Config.define('APP_SECRET_KEY', None, 'SECRET KEY TO CONFIGURE <%= package.name %>', 'Security')

Config.define('WEBASSETS_DIRECTORY', STATIC_PATH, 'Folder to be root directory for webassets', 'Web')
Config.define('WEBASSETS_AUTO_BUILD', True, 'Auto build static files', 'Web')
Config.define('WEBASSETS_CACHE_PATH', '/tmp/<%= package.pythonName %>/.webassets_cache', 'WebAssets cache path', 'Web')

<% if (package.services.mongodb && package.flask.mongoengine) { %>
Config.define('MONGODB_HOST', 'localhost', 'Host for the MongoDB database', 'MongoDB')
Config.define('MONGODB_DB', '<%= package.pythonName %>', 'Database name for the MongoDB database', 'MongoDB')
Config.define('MONGODB_PORT', 3333, 'Port for the MongoDB database', 'MongoDB')
Config.define('MONGODB_USERNAME', None, 'Username for the MongoDB database', 'MongoDB')
Config.define('MONGODB_PASSWORD', None, 'Password for the MongoDB database', 'MongoDB')
<% } %>
<% if (package.flask.sqlalchemy) { %>
Config.define(
    'SQLALCHEMY_DATABASE_URI',
示例#20
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

# This file is part of tornado_angular.
# https://github.com/heynemann/tornado-angular

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2014 Bernardo Heynemann [email protected]

from derpconf.config import Config  # NOQA

Config.define('ANGULAR_ROOT', './web', 'Angular root app path.', 'Angular')
示例#21
0
from derpconf.config import Config

Config.allow_environment_variables()

Config.define("ENV", "development", "Environment application is running in",
              "General")
Config.define(
    "SECRET_KEY",
    "OTNDN0VCRDAtRTMyMS00NUM0LUFFQUYtNEI4QUE4RkFCRjUzCg==",
    "Secret key to use in flask.",
    "General",
)

Config.define("REDIS_URL", "redis://localhost:10100/0",
              "Redis connection string", "Redis")

Config.define(
    "WORKER_SLEEP_TIME_MS",
    10,
    "Number of milliseconds that fastlane must sleep before getting the next job",
    "Worker",
)

Config.define(
    "HARD_EXECUTION_TIMEOUT_SECONDS",
    30 * 60,
    "Number of seconds that fastlane must wait before killing an execution",
    "Worker",
)

Config.define(
示例#22
0
        def topic(self):
            conf = Config()
            conf.define('S3_ALLOWED_BUCKETS', [], '')

            return Context(config=conf)
示例#23
0
        def topic(self, callback):
            conf = Config()
            conf.define('TC_AWS_ALLOWED_BUCKETS', [], '')

            context = Context(config=conf)
            s3_loader.load(context, '/'.join([s3_bucket, IMAGE_PATH]), callback)
示例#24
0
 def topic(self):
     Config.define('some_key', 'default', 'test key')
     return Config.load(fix('missing.conf'))
示例#25
0
# -*- coding: utf-8 -*-

# This file is part of server.
# https://github.com/someuser/somepackage

# Licensed under the MIT license:
# http://www.opensource.org/licenses/MIT-license
# Copyright (c) 2018, Jacek Burys <*****@*****.**>

import os
from derpconf.config import Config, generate_config

STATIC_PATH = os.path.abspath(
    os.path.join(os.path.dirname(__file__), '..', 'static'))

Config.define('APP_SECRET_KEY', None, 'SECRET KEY TO CONFIGURE server',
              'Security')

Config.define('WEBASSETS_DIRECTORY', STATIC_PATH,
              'Folder to be root directory for webassets', 'Web')
Config.define('WEBASSETS_AUTO_BUILD', True, 'Auto build static files', 'Web')
Config.define('WEBASSETS_CACHE_PATH', '/tmp/server/.webassets_cache',
              'WebAssets cache path', 'Web')


def init_app(app, path=None):
    conf = Config.load(path)
    for conf_option, _ in conf.items.items():
        app.config[conf_option] = conf[conf_option]

    app.secret_key = app.config['APP_SECRET_KEY']
示例#26
0
# https://github.com/globocom/thumbor/wiki

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

from os.path import join
import tempfile

import derpconf.config as config
from derpconf.config import Config

from thumbor import __version__

Config.define(
    'THUMBOR_LOG_FORMAT', '%(asctime)s %(name)s:%(levelname)s %(message)s',
    'Log Format to be used by thumbor when writing log messages.', 'Logging')

Config.define(
    'THUMBOR_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
    'Date Format to be used by thumbor when writing log messages.', 'Logging')

Config.define('MAX_WIDTH', 0, "Max width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MAX_HEIGHT', 0, "Max height in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_WIDTH', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_HEIGHT', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('ALLOWED_SOURCES', [], "Allowed domains for the http loader to download. These are regular expressions.", 'Imaging')
Config.define('QUALITY', 80, 'Quality index used for generated JPEG images', 'Imaging')
Config.define('WEBP_QUALITY', None, 'Quality index used for generated WebP images. If not set (None) the same level of JPEG quality will be used.', 'Imaging')
Config.define('AUTO_WEBP', False, 'Specifies whether WebP format should be used automatically if the request accepts it (via Accept header)', 'Imaging')
Config.define('MAX_AGE', 24 * 60 * 60, 'Max AGE sent as a header for the image served by thumbor in seconds', 'Imaging')
示例#27
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from os.path import abspath, dirname, join

web_root_path = abspath(join(dirname(__file__), '..', '..', 'shamester-web', 'dist'))

from derpconf.config import Config

Config.define('MONGOHOST', 'localhost', "Database configuration", "Database")
Config.define('MONGOPORT', 6680, "Database configuration", "Database")
Config.define('MONGODATABASE', 'shamester', "Database configuration", "Database")

Config.define('REDISHOST', 'localhost', "Database configuration", "Database")
Config.define('REDISPORT', 7777, "Database configuration", "Database")

Config.define('WEB_ROOT_PATH', web_root_path, "Root path for the web app.", "Web")
Config.define('ENVIRONMENT', 'local', "Defines the javascript include to be used.", "Web")
Config.define('API_URL', 'http://localhost:3000/', "Defines the base URL for the API.", "Web")
示例#28
0
from tc_shortener.handlers.shortener import UrlShortenerHandler

extension = Extension('tc_shortener')

# Register the required modules
extension.add_module(
    config_key='SHORTENER_GENERATOR',
    class_name='Generator',
    multiple=False
)

extension.add_module(
    config_key='SHORTENER_STORAGE',
    class_name='Storage',
    multiple=False
)

Config.define('SHORTENER_GENERATOR', 'tc_shortener.generators.sha256_generator', 'Shortened URL generator class.', 'Shortener')
Config.define('SHORTENER_STORAGE',   'tc_shortener.storages.redis_storage',      'Shortened URL storage.',         'Shortener')


Config.define('SHORTENER_REDIS_STORAGE_SERVER_HOST',     'localhost', 'Redis hostname.',           'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_PORT',     6379,        'Redis port.',               'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_PASSWORD', None,        'Redis password.',           'Shortener')
Config.define('SHORTENER_REDIS_STORAGE_SERVER_DB',       0,           'Redis db name (optional).', 'Shortener')

# Register the route
extension.add_handler(UrlShortenerHandler.regex(), UrlShortenerHandler)

Extensions.register(extension)
示例#29
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# This file is part of <%= package.name %>.
# <%= package.url %>

# Licensed under the <%= package.license %> license:
# http://www.opensource.org/licenses/<%= package.license%>-license
# Copyright (c) <%= package.created.year %>, <%= package.author.name %> <<%= package.author.email %>>

import os
from derpconf.config import Config, generate_config

STATIC_PATH = os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'static'))

Config.define('APP_SECRET_KEY', None, 'SECRET KEY TO CONFIGURE <%= package.name %>', 'Security')

Config.define('WEBASSETS_DIRECTORY', STATIC_PATH, 'Folder to be root directory for webassets', 'Web')
Config.define('WEBASSETS_AUTO_BUILD', True, 'Auto build static files', 'Web')
Config.define('WEBASSETS_CACHE_PATH', '/tmp/<%= package.pythonName %>/.webassets_cache', 'WebAssets cache path', 'Web')

<% if (package.services.mongodb && package.flask.mongoengine) { %>
Config.define('MONGODB_HOST', 'localhost', 'Host for the MongoDB database', 'MongoDB')
Config.define('MONGODB_DB', '<%= package.pythonName %>', 'Database name for the MongoDB database', 'MongoDB')
Config.define('MONGODB_PORT', 3333, 'Port for the MongoDB database', 'MongoDB')
Config.define('MONGODB_USERNAME', None, 'Username for the MongoDB database', 'MongoDB')
Config.define('MONGODB_PASSWORD', None, 'Password for the MongoDB database', 'MongoDB')
<% } %>

<% if (package.flask.useAuth) { %>
Config.define('AUTH_PROVIDERS', None, 'Configuration for authentication providers', 'MongoDB')
示例#30
0
文件: config.py 项目: heynemann/wight
# -*- coding: utf-8 -*-

# wight load testing
# https://github.com/heynemann/wight

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


from derpconf.config import Config, generate_config

MINUTES = 60
HOURS = 60 * MINUTES

Config.define('WIGHT_WEB_HOST', 'http://localhost:2368', 'The hostname (and port if needed) for wight-web.', 'Basic')
Config.define('COOKIE_SECRET', '1617401289404f2182bqwelf7cddd0f', 'To sign secure cookie info.', 'Basic')
Config.define('TOKEN_EXPIRATION_IN_MINUTES', 2 * 24 * 60, 'Expiration of authentication tokens in minutes.', 'Basic')

Config.define('MONGO_HOST', '127.0.0.1', 'The host where the Mongo server is running.', 'DB')
Config.define('MONGO_PORT', 7777, 'The port that the Mongo server is running.', 'DB')
Config.define('MONGO_DB', 'wight-api', 'The database name we should use for the api in mongo.', 'DB')
Config.define('MONGO_USER', None, 'The user name to authenticate with mongo.', 'DB')
Config.define('MONGO_PASS', None, 'The password to authenticate with mongo.', 'DB')

Config.define('REDIS_HOST', '127.0.0.1', 'The host where the Redis server is running.', 'Cache')
Config.define('REDIS_PORT', 7780, 'The port that Redis server is running.', 'Cache')
Config.define('REDIS_DB_COUNT', 0, 'The number of redis db.', 'Cache')
Config.define('REDIS_PASSWORD', '', 'The redis password', 'Cache')
Config.define('REDIS_SESSION_EXPIRATION', 7200, 'Time for session expiration in Redis.', 'Cache')
示例#31
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

import multiprocessing

from derpconf.config import Config, generate_config

Config.define('COOKIE_SECRET', '161740d090204f2182bdd0ac47cddd0f', 'To sign secure cookie info.', 'Basic')

Config.define('REDIS_HOST', '127.0.0.1', 'The host where the Redis server is running.', 'Cache')
Config.define('REDIS_PORT', 7775, 'The port that Redis server is running.', 'Cache')
Config.define('REDIS_DB_COUNT', 0, 'The number of redis db.', 'Cache')
Config.define('REDIS_PASSWORD', '', 'The redis password', 'Cache')

Config.define('NUMBER_OF_FORKS', multiprocessing.cpu_count(), 'Number of forks to use for tornado process. Defaults to number of cpus.', 'Runtime')

Config.define('STATIC_URL', '/static/', 'Static files route.', 'Static')


if __name__ == '__main__':
    generate_config()
示例#32
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config

Config.define('TESTCONF', 'test-configuration', "Test configuration in sandbox", 'Section')
示例#33
0
# wight load testing
# https://github.com/heynemann/wight

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

import multiprocessing

from derpconf.config import Config, generate_config

MINUTES = 60
HOURS = 60 * MINUTES

Config.define('COOKIE_SECRET', '1612374289404f2182bqwelf7cddd0f',
              'To sign secure cookie info.', 'Basic')

Config.define('MONGO_HOST', '127.0.0.1',
              'The host where the Mongo server is running.', 'DB')
Config.define('MONGO_PORT', 7777, 'The port that the Mongo server is running.',
              'DB')
Config.define('MONGO_DB', 'wight-api',
              'The database name we should use for the api in mongo.', 'DB')
Config.define('MONGO_USER', None, 'The user name to authenticate with mongo.',
              'DB')
Config.define('MONGO_PASS', None, 'The password to authenticate with mongo.',
              'DB')

Config.define('REDIS_HOST', '127.0.0.1',
              'The host where the Redis server is running.', 'Cache')
Config.define('REDIS_PORT', 7780, 'The port that Redis server is running.',
示例#34
0
文件: config.py 项目: heynemann/wight
    # if libyaml is available we use it, since it's a lot faster
    from yaml import CLoader as Loader
except ImportError:
    # otherwise use pure python implementation
    from yaml import Loader  # NOQA

MINUTES = 60
HOURS = 60 * MINUTES

DEFAULT_CYCLES = {
    "small": [3, 5, 8],  # with 20 funkload instances => 60, 100, 160
    "medium": [10, 20, 30],  # with 20 funkload instances => 200, 400, 600
    "large": [30, 75, 100],  # with 20 funkload instances => 600, 1500, 2000
}

Config.define('CYCLES', DEFAULT_CYCLES, 'The cycles to run in funkload.', 'Funkload')
Config.define('CYCLE_DURATION', 10, 'The cycle duration to run in funkload.', 'Funkload')
Config.define('WORKERS', [], 'The workers definition. Each worker should be defined as a dictionary with host, username and password.', 'Workers')

Config.define('MONGO_HOST', '127.0.0.1', 'The host where the Mongo server is running.', 'DB')
Config.define('MONGO_PORT', 7777, 'The port that the Mongo server is running.', 'DB')
Config.define('MONGO_DB', 'wight-api', 'The database name we should use for the api in mongo.', 'DB')
Config.define('MONGO_USER', None, 'The user name to authenticate with mongo.', 'DB')
Config.define('MONGO_PASS', None, 'The password to authenticate with mongo.', 'DB')

Config.define('REDIS_HOST', '127.0.0.1', 'The host where the Redis server is running.', 'Cache')
Config.define('REDIS_PORT', 7780, 'The port that Redis server is running.', 'Cache')
Config.define('REDIS_DB_COUNT', 0, 'The number of redis db.', 'Cache')
Config.define('REDIS_PASSWORD', '', 'The redis password', 'Cache')

示例#35
0
        def topic(self, callback):
            conf = Config()
            conf.define('TC_AWS_ALLOWED_BUCKETS', [], '')

            context = Context(config=conf)
            s3_loader.load(context, '/'.join([s3_bucket, IMAGE_PATH]), callback)
示例#36
0
文件: config.py 项目: harto/sauron
from derpconf.config import Config
from os import path

Config.define('FRAME_WIDTH',
              '320',
              'Width of video frames',
              'General')

Config.define('BLUR_KERNEL_WIDTH',
              '21',
              'Width of blur filter for input normalisation (must be odd)',
              'Input')

Config.define('BLUR_KERNEL_HEIGHT',
              '21',
              'Height of blur filter for input normalisation (must be odd)',
              'Input')

Config.define('MIN_CHANGE_THRESHOLD',
              '50',
              'Pixel value change threshold for detection events',
              'Detection')

Config.define('MIN_CHANGE_AREA',
              '400',
              'Minimum number of changed pixels for detection events',
              'Detection')

Config.define('OUTPUT_FPS',
              '5',
              'Frames per second of output video',
示例#37
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config  # NOQA
from holmes.utils import _


MINUTE = 60
HOUR = MINUTE * 60
DAY = 24 * HOUR

Config.define('WORKER_SLEEP_TIME', 10, _('Main loop sleep time'), 'Worker')
Config.define('ZOMBIE_WORKER_TIME', 200,
              _('Time to remove a Worker from API List (must be greater than WORKER_SLEEP_TIME + Validation time)'), 'API')

Config.define('WORKERS_LOOK_AHEAD_PAGES', 10000, _('Number of pages that will be retrieved when looking for the next job'), 'Worker')

Config.define('UPDATE_PAGES_SCORE_EXPIRATION', 30, _('The expiration for lock to update pages score'), 'Worker')
Config.define('UPDATE_PAGES_SCORE_SLEEP_TIME', HOUR, _('The expiration for lock to update pages score'), 'Worker')

Config.define('CONNECT_TIMEOUT_IN_SECONDS', 20, _('Number of seconds a connection can take.'), 'Worker')
Config.define('REQUEST_TIMEOUT_IN_SECONDS', 60, _('Number of seconds a request can take.'), 'Worker')

Config.define('HOLMES_API_URL', 'http://localhost:2368', ('URL that Worker will communicate with API'), 'Worker')
Config.define('HOLMES_WEB_URL', 'http://local.holmes.com:9000', _('URL of the client side application of Holmes'), 'Web')

Config.define('LOG_LEVEL', 'ERROR', 'Default log level', 'Logging')
Config.define('LOG_FORMAT', '%(asctime)s:%(levelname)s %(module)s - %(message)s',
              _('Log Format to be used when writing log messages'), 'Logging')
Config.define('LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
              _('Date Format to be used when writing log messages.'), 'Logging')
示例#38
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config, generate_config

Config.define('HEALTHCHECK_TEXT', 'WORKING', 'Healcheck text duhh', 'General')

if __name__ == '__main__':
    generate_config()
示例#39
0
        def topic(self):
            conf = Config()
            conf.define('TC_AWS_ALLOWED_BUCKETS', [], '')

            return Context(config=conf)
示例#40
0
        def topic(self):

            conf = Config()
            conf.define('TC_AWS_MAX_RETRIES', 3, '')
            return Context(config=conf)
示例#41
0
#!/usr/bin/python
# -*- coding: utf-8 -*-

from derpconf.config import Config, generate_config

MINUTES = 60

Config.define(
    'HEALTHCHECK_TEXT', 'WORKING',
    'Cyclops has a /healthcheck route. This allows load balancers to ping it to see if the process is still alive. This option defines the text that the /healthcheck route prints.',
    'General')
Config.define(
    'SENTRY_BASE_URL', 'localhost:9000',
    'Sentry server name. This is the base URL that Cyclops will use to send requests to sentry.',
    'General')
Config.define(
    'UPDATE_PERIOD', 2 * MINUTES,
    "Cyclops keeps sentry's projects public and security keys in memory. This allows a very fast validation as to whether each request is valid. This configuration defines the interval in seconds that Cyclops will update the keys.",
    'General')
Config.define(
    'PROCESS_NEWER_MESSAGES_FIRST', True,
    "This configuration tells cyclops to process newly arrived error reports first. This is very useful to avoid that error bursts stop you from seeing new errors.",
    'General')

Config.define(
    'STORAGE', 'cyclops.storage.InMemoryStorage',
    'The storage class used in Cyclops. Storage classes are what define how received requests will be treated *before* sending to sentry. '
    +
    'Built-ins: "cyclops.storage.InMemoryStorage" and "cyclops.storage.RedisStorage."',
    'General')
示例#42
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-


import derpconf.config as config
from derpconf.config import Config


Config.define('APPLICATION_URL', 'http://0.0.0.0:8080', 'The url to access the running application.', 'General')

Config.define('JSONP_CALLBACK', 'impimCallback', 'Default callback for JSONP responses.', 'General')

Config.define('IMAGES_STORAGE', 'impim_api.domain.storage.FileSystem', 'Defines where the images will be stored.', 'General')
Config.define('METADATA_STORAGE', 'impim_api.domain.storage.ElasticSearch', 'Defines where the metadata will be stored.', 'General')

Config.define('ELASTIC_SEARCH_BASE_URL', 'http://localhost:9200', 'ElasticSearch base url.', 'ElasticSearch')
Config.define('ELASTIC_SEARCH_INDEX', 'impim', 'ElasticSearch index.', 'ElasticSearch')

Config.define('FILE_SYSTEM_ROOT_PATH', '/tmp/impim-api', 'File System root path.', 'File System Storage')

Config.define('AWS_ACCESS_KEY_ID', 'xxx', 'The amazon access key.', 'AWS')
Config.define('AWS_SECRET_ACCESS_KEY', 'yyy', 'The amazon secret key.', 'AWS')
Config.define('AWS_BUCKET_NAME', 'my_bucket', 'The S3 bucket name.', 'AWS')

Config.define('THUMBOR_SECURITY_KEY', 'MY_SECURE_KEY', 'Thumbor security key.', 'Thumbor configuration')
Config.define('THUMBOR_SERVER_URL', 'http://localhost:8888/', 'Thumbor server url.', 'Thumbor configuration')


def generate_config():
    config.generate_config()
示例#43
0
 def topic(self):
     Config.define('some_key', 'default', 'test key')
     return Config.verify(fix('missing.conf'))
示例#44
0
# -*- 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) 2011 globo.com [email protected]

from os.path import join
import tempfile
import derpconf.config as config
from derpconf.config import Config

Config.define('MAX_WIDTH', 0,
              "Max width in pixels for images read or generated by thumbor",
              'Imaging')
Config.define('MAX_HEIGHT', 0,
              "Max height in pixels for images read or generated by thumbor",
              'Imaging')
Config.define('MIN_WIDTH', 1,
              "Min width in pixels for images read or generated by thumbor",
              'Imaging')
Config.define('MIN_HEIGHT', 1,
              "Min width in pixels for images read or generated by thumbor",
              'Imaging')
Config.define(
    'ALLOWED_SOURCES', [],
    "Allowed domains for the http loader to download. These are regular expressions.",
    'Imaging')
Config.define('QUALITY', 80, 'Quality index used for generated JPEG images',
示例#45
0
文件: config.py 项目: thumbor/thumbor
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com [email protected]

import tempfile
from os.path import expanduser, join

from derpconf import config
from derpconf.config import Config

from thumbor import __version__
from thumbor.filters import BUILTIN_FILTERS
from thumbor.handler_lists import BUILTIN_HANDLERS

HOME = expanduser("~")

Config.define("THUMBOR_LOG_CONFIG", None, "Logging configuration as json",
              "Logging")
Config.define(
    "THUMBOR_LOG_FORMAT",
    "%(asctime)s %(name)s:%(levelname)s %(message)s",
    "Log Format to be used by thumbor when writing log messages.",
    "Logging",
)

Config.define(
    "THUMBOR_LOG_DATE_FORMAT",
    "%Y-%m-%d %H:%M:%S",
    "Date Format to be used by thumbor when writing log messages.",
    "Logging",
)

Config.define(
示例#46
0
        def topic(self):
            conf = Config()
            conf.define('AWS_ENABLE_HTTP_LOADER', True, '')

            return Context(config=conf)
示例#47
0
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com [email protected]

from os.path import expanduser, join
import tempfile

import derpconf.config as config
from derpconf.config import Config

from thumbor import __version__

home = expanduser("~")

Config.define('THUMBOR_LOG_CONFIG', None, 'Logging configuration as json',
              'Logging')
Config.define('THUMBOR_LOG_FORMAT',
              '%(asctime)s %(name)s:%(levelname)s %(message)s',
              'Log Format to be used by thumbor when writing log messages.',
              'Logging')

Config.define('THUMBOR_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
              'Date Format to be used by thumbor when writing log messages.',
              'Logging')

Config.define('MAX_WIDTH', 0,
              "Max width in pixels for images read or generated by thumbor",
              'Imaging')
Config.define('MAX_HEIGHT', 0,
              "Max height in pixels for images read or generated by thumbor",
              'Imaging')
示例#48
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

# this file is part of level.
# https://github.com/heynemann/level

# licensed under the mit license:
# http://www.opensource.org/licenses/mit-license
# copyright (c) 2016, bernardo heynemann <*****@*****.**>


import derpconf.config as config
from derpconf.config import Config

Config.define('LEVEL_LOG_CONFIG', None, 'Logging configuration as json', 'Logging')
Config.define(
    'LEVEL_LOG_FORMAT', '%(asctime)s %(name)s:%(levelname)s %(message)s',
    'Log Format to be used by level when writing log messages.', 'Logging'
)

Config.define(
    'LEVEL_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
    'Date Format to be used by level when writing log messages.', 'Logging'
)

Config.define(
    'APP_CLASS', 'level.app.LevelApp',
    'Custom app class to override LevelApp.', 'WebServer',
)

Config.define(
示例#49
0
        def topic(self):
            conf = Config()
            conf.define('TC_AWS_ENABLE_HTTP_LOADER', True, '')

            return Context(config=conf)
示例#50
0
文件: config.py 项目: lmello/thumbor
# -*- 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) 2011 globo.com [email protected]

from os.path import join
import tempfile
import derpconf.config as config
from derpconf.config import Config

Config.define(
    'THUMBOR_LOG_FORMAT', '%(asctime)s %(name)s:%(levelname)s %(message)s',
    'Log Format to be used by thumbor when writing log messages.', 'Logging')

Config.define(
    'THUMBOR_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
    'Date Format to be used by thumbor when writing log messages.', 'Logging')

Config.define('MAX_WIDTH', 0, "Max width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MAX_HEIGHT', 0, "Max height in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_WIDTH', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('MIN_HEIGHT', 1, "Min width in pixels for images read or generated by thumbor", 'Imaging')
Config.define('ALLOWED_SOURCES', [], "Allowed domains for the http loader to download. These are regular expressions.", 'Imaging')
Config.define('QUALITY', 80, 'Quality index used for generated JPEG images', 'Imaging')
Config.define('MAX_AGE', 24 * 60 * 60, 'Max AGE sent as a header for the image served by thumbor in seconds', 'Imaging')
Config.define(
    'MAX_AGE_TEMP_IMAGE', 0,
示例#51
0
文件: config.py 项目: hfeeki/thumbor
# https://github.com/globocom/thumbor/wiki

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

from os.path import join
import tempfile

import derpconf.config as config
from derpconf.config import Config

from thumbor import __version__

Config.define('THUMBOR_LOG_FORMAT',
              '%(asctime)s %(name)s:%(levelname)s %(message)s',
              'Log Format to be used by thumbor when writing log messages.',
              'Logging')

Config.define('THUMBOR_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
              'Date Format to be used by thumbor when writing log messages.',
              'Logging')

Config.define('MAX_WIDTH', 0,
              "Max width in pixels for images read or generated by thumbor",
              'Imaging')
Config.define('MAX_HEIGHT', 0,
              "Max height in pixels for images read or generated by thumbor",
              'Imaging')
Config.define('MIN_WIDTH', 1,
              "Min width in pixels for images read or generated by thumbor",
              'Imaging')
示例#52
0
# thumbor imaging service
# https://github.com/globocom/thumbor/wiki

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

from os.path import join
import tempfile

import derpconf.config as config
from derpconf.config import Config

from thumbor import __version__

Config.define('THUMBOR_LOG_CONFIG', None, 'Logging configuration as json', 'Logging')
Config.define(
    'THUMBOR_LOG_FORMAT', '%(asctime)s %(name)s:%(levelname)s %(message)s',
    'Log Format to be used by thumbor when writing log messages.', 'Logging')

Config.define(
    'THUMBOR_LOG_DATE_FORMAT', '%Y-%m-%d %H:%M:%S',
    'Date Format to be used by thumbor when writing log messages.', 'Logging')

Config.define(
  'STATSD_HOST', None,
  'Host to send statsd instrumentation to', 'Logging')

Config.define(
  'STATSD_PREFIX', None,
  'Prefix for statsd', 'Logging')
示例#53
0
from os import path

from derpconf.config import Config as c, verify_config, generate_config

# Core options

c.define('BACKEND',
         'github',
         'Specify issue-tracking backend')

c.define('DB',
         'githubsurvivor',
         'Mongo database to use as local datastore')

c.define('DB_HOST',
         None,
         'Mongo database uri, for use with eg heroku')

c.define('FLASK_DEBUG',
         False,
         'Whether to display the interactive debugger on error. Don\'t enable this in publicly-accessible environments.')

c.define('FLASK_SETTINGS',
         {'host': '127.0.0.1', 'port': 5000},
         'Options to pass to Flask initialiser')

# GitHub options

c.define('GITHUB_REPO',
         None,
         'Specify the GitHub repo you want to report on',