def requestLayer(config, path_info):
 if (type(config) in (str, unicode)):
  key = (hasattr(config, '__hash__') and (config, getcwd()))
  if (key in _previous_configs):
   config = _previous_configs[key]
  else:
   config = parseConfig(config)
   if key:
    _previous_configs[key] = config
 else:
  assert hasattr(config, 'cache'), 'Configuration object must have a cache.'
  assert hasattr(config, 'layers'), 'Configuration object must have layers.'
  assert hasattr(config, 'dirpath'), 'Configuration object must have a dirpath.'
 path_info = ('/' + (path_info or '').lstrip('/'))
 if (path_info == '/'):
  return Core.Layer(config, None, None)
 layername = splitPathInfo(path_info)[0]
 if (layername not in config.layers):
  raise Core.KnownUnknown(('"%s" is not a layer I know about. Here are some that I do know about: %s.' % (layername, ', '.join(sorted(config.layers.keys())))))
 return config.layers[layername]

def requestLayer ( config , path_info ) : if ( type ( config ) in ( str , unicode ) ) : key = ( hasattr ( config , '__hash__' ) and ( config , getcwd ( ) ) ) if ( key in _previous_configs ) : config = _previous_configs [ key ] else : config = parseConfig ( config ) if key : _previous_configs [ key ] = config else : assert hasattr ( config , 'cache' ) , 'Configuration object must have a cache.' assert hasattr ( config , 'layers' ) , 'Configuration object must have layers.' assert hasattr ( config , 'dirpath' ) , 'Configuration object must have a dirpath.' path_info = ( '/' + ( path_info or '' ) . lstrip ( '/' ) ) if ( path_info == '/' ) : return Core . Layer ( config , None , None ) layername = splitPathInfo ( path_info ) [ 0 ] if ( layername not in config . layers ) : raise Core . KnownUnknown ( ( '"%s" is not a layer I know about. Here are some that I do know about: %s.' % ( layername , ', ' . join ( sorted ( config . layers . keys ( ) ) ) ) ) ) return config . layers [ layername ]
return a layer .