示例#1
0
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings['storage_max_fetch_size'])
    strict = settings.get('storage_strict_json', False)
    client = create_from_config(config, prefix='storage_')
    return Storage(client=client,
                   max_fetch_size=max_fetch_size,
                   strict_json=strict)
示例#2
0
文件: __init__.py 项目: zeroyou/kinto
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings["storage_max_fetch_size"])
    readonly = settings.get("readonly", False)
    client = create_from_config(config, prefix="storage_")
    return Storage(client=client,
                   max_fetch_size=max_fetch_size,
                   readonly=readonly)
示例#3
0
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings['storage_max_fetch_size'])
    strict = settings.get('storage_strict_json', False)
    readonly = settings.get('readonly', False)
    client = create_from_config(config, prefix='storage_')
    return Storage(client=client, max_fetch_size=max_fetch_size, strict_json=strict,
                   readonly=readonly)
示例#4
0
    def setUp(self):
        from kinto.core.storage.postgresql.client import create_from_config

        self.connections = []
        self.errors = []

        config = testing.setUp(settings={
            'pooltest_url': 'sqlite:///:memory:',
            'pooltest_pool_size': 2,
            'pooltest_pool_timeout': 1,
            'pooltest_max_backlog': 2,
            'pooltest_max_overflow': 1,
        })
        # Create an engine with known pool parameters.
        # Use create_from_config() to make sure it is used by default
        # and handles parameters.
        client = create_from_config(config, prefix='pooltest_')
        session = client.session_factory()
        self.engine = session.get_bind()
示例#5
0
def load_from_config(config):
    client = create_from_config(config, prefix='permission_')
    return Permission(client=client)
示例#6
0
def load_from_config(config):
    client = create_from_config(config, prefix='permission_')
    return Permission(client=client)
示例#7
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config,
                                prefix='cache_',
                                with_transaction=False)
    return Cache(client=client, cache_prefix=settings['cache_prefix'])
示例#8
0
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings['storage_max_fetch_size'])
    client = create_from_config(config, prefix='storage_')
    return Storage(client=client, max_fetch_size=max_fetch_size)
示例#9
0
文件: __init__.py 项目: swhgoon/kinto
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_')
    return Cache(client=client, cache_prefix=settings['cache_prefix'])
示例#10
0
def load_from_config(config):
    settings = config.get_settings()
    max_fetch_size = int(settings['storage_max_fetch_size'])
    client = create_from_config(config, prefix='storage_')
    return Storage(client=client, max_fetch_size=max_fetch_size)
示例#11
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_')
    return Cache(client=client, cache_prefix=settings['cache_prefix'])
示例#12
0
def load_from_config(config):
    settings = config.get_settings()
    client = create_from_config(config, prefix='cache_', with_transaction=False)
    return Cache(client=client, cache_prefix=settings['cache_prefix'])