Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(7)  |  Call(3)  |  Derive(0)  |  Import(4)
Load the plugin from the given section in a settings dict.

This function loads a plugin using prefixed settings from the pyramid
settings dict.  Any keys in the settings dict that start with the
given section name plus a dot will be used.

This a compatability function for use when a Config object is not
available; load_from_config will usually be faster.

        def load_from_settings(section_name, settings):
    """Load the plugin from the given section in a settings dict.

    This function loads a plugin using prefixed settings from the pyramid
    settings dict.  Any keys in the settings dict that start with the
    given section name plus a dot will be used.

    This a compatability function for use when a Config object is not
    available; load_from_config will usually be faster.
    """
    kwargs = {}
    prefix = section_name + "."
    for name, value in settings.iteritems():
        if name.startswith(prefix):
            kwargs[name[len(prefix):]] = value
    klass = resolve_name(kwargs.pop("backend"))
    return klass(**kwargs)
        


src/t/o/tokenserver-HEAD/tokenserver/__init__.py   tokenserver(Download)
 
from mozsvc.config import get_configurator
from mozsvc.plugin import load_and_register, load_from_settings
 
 
        settings['metlog.sender_class'] = 'metlog.senders.StdOutSender'
 
    metlog_wrapper = load_from_settings('metlog', settings)
 
    if settings['metlog.enabled']:
        settings['tokenserver.secrets.backend'] = 'mozsvc.secrets.Secrets'
        settings['tokenserver.secrets.filename'] = secrets_file
    secrets = load_from_settings('tokenserver.secrets', settings)
    settings['tokenserver.secrets'] = secrets
 

src/m/o/mozsvc-0.7/mozsvc/metrics.py   mozsvc(Download)
import threading
 
from mozsvc.plugin import load_from_settings
 
 

src/m/o/mozservices-HEAD/mozsvc/metrics.py   mozservices(Download)
import threading
 
from mozsvc.plugin import load_from_settings
 
 

src/t/o/tokenserver-HEAD/tokenserver/tests/test_service.py   tokenserver(Download)
from cornice.tests.support import CatchErrors
from mozsvc.config import load_into_settings
from mozsvc.plugin import load_and_register, load_from_settings
 
from metlog.logging import hook_logger
        load_into_settings(self.get_ini(), settings)
        self.config.add_settings(settings)
        metlog_wrapper = load_from_settings('metlog',
                                            self.config.registry.settings)
        for logger in ('tokenserver', 'mozsvc'):