Configure the Pylons environment via the ``pylons.config``
    object
341326
def load_environment(global_conf, app_conf):
    
    # Pylons paths
    root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
    paths = dict(root=root,
                 controllers=os.path.join(root, 'controllers'),
                 static_files=os.path.join(root, 'public'),
                 templates=[os.path.join(root, 'templates')])

    # Initialize config with the basic options
    config.init_app(global_conf, app_conf, package='chatapp', paths=paths)

    config['routes.map'] = make_map()
    config['pylons.app_globals'] = app_globals.Globals()
    config['pylons.h'] = chatapp.lib.helpers

    # Create the Mako TemplateLookup, with the default auto-escaping
    config['pylons.app_globals'].mako_lookup = TemplateLookup(
        directories=paths['templates'], input_encoding='utf-8',
        imports=['from webhelpers.html import escape'],
        default_filters=['escape'], output_encoding='utf-8',
        module_directory=os.path.join(app_conf['cache_dir'], 'templates'),
    )
74449
def setup_config(command, filename, section, vars):
    """"""
    conf = appconfig('config:' + filename)
    load_environment(conf.global_conf, conf.local_conf)
46053
def configure(conf, default_config=None):
    
    if conf.logconfig and os.path.isfile(conf.logconfig):
        logging.config.fileConfig(conf.logconfig,
                                  disable_existing_loggers=False)
    elif default_config and os.path.isfile(default_config):
        logging.config.fileConfig(default_config,
                                  disable_existing_loggers=False)
    else:
        init_console_logging(conf)
841703
def load_configuration(self, **kwargs):
        ''''''
        # update passed arguments with default values
        for key in settings.ACTIVE_URL_KWARGS:
            kwargs.setdefault(key, settings.ACTIVE_URL_KWARGS[key])

        # "active" html tag css class
        self.css_class = kwargs['css_class']
        # "active" html tag
        self.parent_tag = kwargs['parent_tag']
        # flipper for menu support
        self.menu = kwargs['menu']
        # whether to ignore / chomp get_params
        self.ignore_params = kwargs['ignore_params']
422614
def configure(self, config):
        
        parameters = config.get_section("parameters")
        if len(parameters) > 0:
            self._parameters = parameters
688545
def configure(env=:default, &block)
      environment = config_attributes[env.to_sym]

      Builder.new(environment, &block)
    end
278397
protected function configure()
    {
        $this->setName('springbot:queue:enqueue')
            ->setDescription('Enqueue Job')
            ->addArgument(self::CLASS_ARGUMENT, InputArgument::REQUIRED)
            ->addArgument(self::METHOD_ARGUMENT, InputArgument::REQUIRED)
            ->addArgument(self::QUEUE_ARGUMENT, null, '', 'default')
            ->addArgument(self::PRIORITY_ARGUMENT, null, '', 1)
            ->addArgument(self::PARAMS_ARGUMENT, InputArgument::IS_ARRAY);
    }
39449
def saltenviron(environ):
    '''
    
    '''
    if '__opts__' not in locals():
        import salt.config
        __opts__ = salt.config.client_config(
                os.environ.get('SALT_MASTER_CONFIG', '/etc/salt/master'))

    environ['SALT_OPTS'] = __opts__
    environ['SALT_APIClient'] = salt.netapi.NetapiClient(__opts__)
1372965
def _setup_environ(self):
        
        _pam_env_watcher.check()
        _etc_env_watcher.check()
        env = dict(self.extra_env or {})
        if self.env:
            env.update(self.env)
        self._env = TemporaryEnvironment(env)
867365
def configure(self, graph, spanning_tree):
        
        self.graph = graph
        self.spanning_tree = spanning_tree
833839
def _setup_config_from_kwargs(kwargs):
        """"""
        cmd_list = ['--json', '--force']

        if 'file' in kwargs:
            cmd_list.extend(['--file', kwargs['file']])

        if 'system' in kwargs:
            cmd_list.append('--system')

        return cmd_list
1125832
def configure():
    
    yaml.add_multi_representer(Step, step_multi_representer)
    yaml.add_multi_constructor('!step', step_multi_constructor)
    yaml.Dumper.ignore_aliases = lambda *args: True
725318
def run(self):
        
        env_name = self.env_name or BUILD_JSON_ENV
        try:
            build_cfg_json = os.environ[env_name]
        except KeyError:
            self.log.error("build config not found in env variable '%s'", env_name)
            return None
        else:
            try:
                return self.substitute_configuration(json.loads(build_cfg_json))
            except ValueError:
                self.log.error("couldn't load build config: invalid json")
                return None
320253
def _setup(self):
        
        context_module = os.environ.get(ENVIRONMENT_CONTEXT_VARIABLE, 'context')
        if not context_module:
            raise ImproperlyConfigured(
                'Requested context points to an empty variable. '
                'You must either define the environment variable {0} '
                'or call context.configure() before accessing the context.'
                .format(ENVIRONMENT_CONTEXT_VARIABLE))

        self._wrapped = Settings(context_module, default_settings=global_context)
527997
def configure_settings():
    
    if not settings.configured:
        db_config = {
            'ENGINE': 'django.db.backends.sqlite3',
            'NAME': 'django_kittens_db.sqlite3',
        }

        settings.configure(
            TEST_RUNNER='django_nose.NoseTestSuiteRunner',
            NOSE_ARGS=['--nocapture', '--nologcapture', '--verbosity=1'],
            DATABASES={
                'default': db_config,
            },
            INSTALLED_APPS=(
                'django.contrib.auth',
                'django.contrib.contenttypes',
                'django.contrib.sessions',
                'django.contrib.admin',
                'django_kittens',
                'django_kittens.tests',
            ),
            ROOT_URLCONF='django_kittens.urls',
            DEBUG=True,
            MIDDLEWARE_CLASSES=(),
        )
1241747
def config(self, **kwargs):
        
        self._canvaswidth = kwargs.pop("canvaswidth", self._canvaswidth)
        self._canvasheight = kwargs.pop("canvasheight", self._canvasheight)
        self.canvas.config(width=self._canvaswidth, height=self._canvasheight)
        self._function_new = kwargs.pop("function_new", self._function_new)
        self._callback_add = kwargs.pop("callback_add", self._callback_add)
        self._callback_del = kwargs.pop("callback_del", self._callback_del)
        self._callback_move = kwargs.pop("callback_move", self._callback_move)
        ttk.Frame.config(self, **kwargs)
753113
def setup(self, environ):
        ''''''
        json_handler = Root().putSubHandler('calc', Calculator())
        middleware = wsgi.Router('/', post=json_handler,
                                 accept_content_types=JSON_CONTENT_TYPES)
        response = [wsgi.GZipMiddleware(200)]
        return wsgi.WsgiHandler(middleware=[wsgi.wait_for_body_middleware,
                                            middleware],
                                response_middleware=response)