コード例 #1
0
ファイル: pyramid.py プロジェクト: gabelula/mx-ocds
def includeme(config):
    """ Setup the dealer. """
    settings = dict(DEFAULTS)
    settings.update(dict(
        (key.split('.', 1)[1], value)
        for key, value in config.registry.settings.items()
        if key.startswith('dealer.')
    ))
    config.registry.settings['dealer'] = settings
    config.registry.dealer = get_backend(
        settings['type'], path=settings['path'], filename=settings['filename'],
        backends=settings['backends'], silent=settings['silent'],
    )

    if settings['context']:
        config.add_subscriber(dealer_context, 'pyramid.events.BeforeRender')
コード例 #2
0
def includeme(config):
    """ Setup the dealer. """
    settings = dict(DEFAULTS)
    settings.update(
        dict((key.split('.', 1)[1], value)
             for key, value in config.registry.settings.items()
             if key.startswith('dealer.')))
    config.registry.settings['dealer'] = settings
    config.registry.dealer = get_backend(
        settings['type'],
        path=settings['path'],
        filename=settings['filename'],
        backends=settings['backends'],
        silent=settings['silent'],
    )

    if settings['context']:
        config.add_subscriber(dealer_context, 'pyramid.events.BeforeRender')
コード例 #3
0
    def test_backends(self):
        from dealer import get_backend

        path = op.dirname(__file__)
        auto = get_backend('auto', path=path, backends=('simple', 'git'))
        self.assertTrue(auto.repo)
コード例 #4
0
    def test_common(self):
        from dealer import get_backend

        git = get_backend('git')
        self.assertTrue(git.repo)
コード例 #5
0
ファイル: settings.py プロジェクト: weaver-viii/dealer
from django.conf import settings
from dealer import get_backend


TYPE = getattr(settings, 'DEALER_TYPE', 'auto')
PATH = getattr(settings, 'DEALER_PATH', None)
FILENAME = getattr(settings, 'DEALER_FILENAME', None)
BACKENDS = getattr(settings, 'DEALER_BACKENDS', None)


BACKEND = get_backend(TYPE, path=PATH, filename=FILENAME, backends=BACKENDS)
コード例 #6
0
ファイル: test_dealer.py プロジェクト: klen/dealer
def test_common():
    from dealer import get_backend

    git = get_backend('git')
    assert git.repo
コード例 #7
0
from django.conf import settings
from dealer import get_backend

TYPE = getattr(settings, 'DEALER_TYPE', 'auto')
PATH = getattr(settings, 'DEALER_PATH', None)
FILENAME = getattr(settings, 'DEALER_FILENAME', None)
BACKENDS = getattr(settings, 'DEALER_BACKENDS', None)

BACKEND = get_backend(TYPE, path=PATH, filename=FILENAME, backends=BACKENDS)
コード例 #8
0
def test_common():
    from dealer import get_backend

    git = get_backend('git')
    assert git.repo