def _outputs(self, cfg, sources): outputs = {} for output in cfg.outputs: output_type = output['type'] create_fn = plugin('output', output_type, 'create') outputs[output_type] = create_fn(cfg.regions, sources, output) return outputs
def _sources(self, cfg): sources = [] for source in cfg.sources: source_type = source['type'] create_fn = plugin('source', source_type, 'create') sources.append((source_type, create_fn(source))) return sources
def _make_queue(j, config): """ Makes a queue object by looking up the plugin module mentioned in the type parameter of the configuration. """ typ = config['type'] create_fn = plugin('queue', typ, 'create') return create_fn(j, config)
def __init__(self, cfg): store_type = cfg['store']['type'] create_fn = plugin('store', store_type, 'create') self.store = create_fn(cfg['store']) self.cache_dir = cfg['cache_dir']
def _store(self, store_cfg): store_type = store_cfg['type'] create_fn = plugin('store', store_type, 'create') return create_fn(store_cfg)