@util.positional(1)
def service_mappings(services, registry_path=DEFAULT_REGISTRY_PATH):
 if isinstance(services, dict):
  services = services.iteritems()
 final_mapping = []
 paths = set()
 registry_map = ({} if registry_path else None)
 for (service_path, service_factory) in services:
  try:
   service_class = service_factory.service_class
  except AttributeError:
   service_class = service_factory
  if (service_path not in paths):
   paths.add(service_path)
  else:
   raise remote.ServiceConfigurationError(('Path %r is already defined in service mapping' % service_path.encode('utf-8')))
  if (registry_map is not None):
   registry_map[service_path] = service_class
  final_mapping.append(service_mapping(service_factory, service_path))
 if (registry_map is not None):
  final_mapping.append(service_mapping(registry.RegistryService.new_factory(registry_map), registry_path))
 return wsgi_util.first_found(final_mapping)

@ util . positional ( 1 ) def service_mappings ( services , registry_path = DEFAULT_REGISTRY_PATH ) : if isinstance ( services , dict ) : services = services . iteritems ( ) final_mapping = [ ] paths = set ( ) registry_map = ( { } if registry_path else None ) for ( service_path , service_factory ) in services : try : service_class = service_factory . service_class except AttributeError : service_class = service_factory if ( service_path not in paths ) : paths . add ( service_path ) else : raise remote . ServiceConfigurationError ( ( 'Path %r is already defined in service mapping' % service_path . encode ( 'utf-8' ) ) ) if ( registry_map is not None ) : registry_map [ service_path ] = service_class final_mapping . append ( service_mapping ( service_factory , service_path ) ) if ( registry_map is not None ) : final_mapping . append ( service_mapping ( registry . RegistryService . new_factory ( registry_map ) , registry_path ) ) return wsgi_util . first_found ( final_mapping )
create multiple service mappings with optional registryservice .