def buildConfiguration(config_dict, dirpath='.'):
 (scheme, h, path, p, q, f) = urlparse(dirpath)
 if (scheme in ('', 'file')):
  sys.path.insert(0, path)
 cache_dict = config_dict.get('cache', {})
 cache = _parseConfigCache(cache_dict, dirpath)
 config = Configuration(cache, dirpath)
 for (name, layer_dict) in config_dict.get('layers', {}).items():
  config.layers[name] = _parseConfigLayer(layer_dict, config, dirpath)
 if ('index' in config_dict):
  index_href = urljoin(dirpath, config_dict['index'])
  index_body = urlopen(index_href).read()
  index_type = guess_type(index_href)
  config.index = (index_type[0], index_body)
 if ('logging' in config_dict):
  level = config_dict['logging'].upper()
  if hasattr(logging, level):
   logging.basicConfig(level=getattr(logging, level))
 return config

def buildConfiguration ( config_dict , dirpath = '.' ) : ( scheme , h , path , p , q , f ) = urlparse ( dirpath ) if ( scheme in ( '' , 'file' ) ) : sys . path . insert ( 0 , path ) cache_dict = config_dict . get ( 'cache' , { } ) cache = _parseConfigCache ( cache_dict , dirpath ) config = Configuration ( cache , dirpath ) for ( name , layer_dict ) in config_dict . get ( 'layers' , { } ) . items ( ) : config . layers [ name ] = _parseConfigLayer ( layer_dict , config , dirpath ) if ( 'index' in config_dict ) : index_href = urljoin ( dirpath , config_dict [ 'index' ] ) index_body = urlopen ( index_href ) . read ( ) index_type = guess_type ( index_href ) config . index = ( index_type [ 0 ] , index_body ) if ( 'logging' in config_dict ) : level = config_dict [ 'logging' ] . upper ( ) if hasattr ( logging , level ) : logging . basicConfig ( level = getattr ( logging , level ) ) return config
build a configuration dictionary into a configuration object .