def load_backend(build_configuration, backend_package):
 backend_module = (backend_package + u'.register')
 try:
  module = importlib.import_module(backend_module)
 except ImportError as e:
  traceback.print_exc()
  raise BackendConfigurationError(u'Failed to load the {backend} backend: {error}'.format(backend=backend_module, error=e))
 def invoke_entrypoint(name):
  entrypoint = getattr(module, name, (lambda : None))
  try:
   return entrypoint()
  except TypeError as e:
   traceback.print_exc()
   raise BackendConfigurationError(u'Entrypoint {entrypoint} in {backend} must be a zero-arg callable: {error}'.format(entrypoint=name, backend=backend_module, error=e))
 build_file_aliases = invoke_entrypoint(u'build_file_aliases')
 if build_file_aliases:
  build_configuration.register_aliases(build_file_aliases)
 subsystems = invoke_entrypoint(u'global_subsystems')
 if subsystems:
  build_configuration.register_subsystems(subsystems)
 invoke_entrypoint(u'register_goals')

def load_backend ( build_configuration , backend_package ) : backend_module = ( backend_package + u'.register' ) try : module = importlib . import_module ( backend_module ) except ImportError as e : traceback . print_exc ( ) raise BackendConfigurationError ( u'Failed to load the {backend} backend: {error}' . format ( backend = backend_module , error = e ) ) def invoke_entrypoint ( name ) : entrypoint = getattr ( module , name , ( lambda : None ) ) try : return entrypoint ( ) except TypeError as e : traceback . print_exc ( ) raise BackendConfigurationError ( u'Entrypoint {entrypoint} in {backend} must be a zero-arg callable: {error}' . format ( entrypoint = name , backend = backend_module , error = e ) ) build_file_aliases = invoke_entrypoint ( u'build_file_aliases' ) if build_file_aliases : build_configuration . register_aliases ( build_file_aliases ) subsystems = invoke_entrypoint ( u'global_subsystems' ) if subsystems : build_configuration . register_subsystems ( subsystems ) invoke_entrypoint ( u'register_goals' )
loads a backend for interacting with the search engine .