Beispiel #1
0
 def app_config(self, name):
     if name is DEFAULT:
         name = 'main'
     # Obviously this will throw a KeyError if the config isn't there.
     # A real implementation would have error handling here.
     config = self._config['application'][name]
     return LoadableConfig.app(name=name, config=config, global_config={})
Beispiel #2
0
    def app_config(self, name):
        # Obviously this will throw a KeyError if the config isn't there.
        # A real implementation would have error handling here.
        if name not in self._config["application"]:
            logger.error("%s is not defined in your application config" % name)
            sys.exit(-1)

        config = self._config["application"][name]
        return LoadableConfig.app(name=name, config=config, global_config={})
Beispiel #3
0
    def app_config(self, name):
        # Obviously this will throw a KeyError if the config isn't there.
        # A real implementation would have error handling here.
        if name not in self._config['application']:
            logger.error('%s is not defined in your application config' % name)
            sys.exit(-1)

        config = self._config['application'][name]
        return LoadableConfig.app(name=name, config=config, global_config={})
Beispiel #4
0
    def _postprocess_context(self, name):
        context_data = self.contexts[name]
        context_data['context'].local_conf.pop('filter-with', None)
        context_data['context'].local_conf.pop('next', None)
        if context_data['filter-with'] is not None:
            context_data['context'].local_conf['filter-with'] = context_data['filter-with']
        context = context_data['context']
        local_conf = {}
        local_conf.update(context.local_conf)
        use_conf = local_conf.pop('_montague_use')
        local_conf.update(use_conf)
        # if context.object_type not in (FILTER_WITH, FILTER_APP):
        #    raise ValueError('pdb here')

        assert context.object_type in TYPEMAP
        # Sending a loadable_type of 'app' for composite
        # will break when it's a 'call' use type instead of 'egg'
        # TODO: write a test to catch this
        config = LoadableConfig(
            name=name, config=local_conf,
            global_config=context.global_conf,
            loadable_type=TYPEMAP[context.object_type],
            entry_point_groups=[context.protocol])
        return config
Beispiel #5
0
 def server_config(self, name):
     if name is DEFAULT:
         name = 'main'
     config = self._config['server'][name]
     return LoadableConfig.server(name=name, config=config, global_config={})
Beispiel #6
0
    def server_config(self, name):
        config = self._config["server"][name]

        return LoadableConfig.server(name=name, config=config, global_config={})
Beispiel #7
0
    def server_config(self, name):
        config = self._config['server'][name]

        return LoadableConfig.server(
            name=name, config=config, global_config={}
        )