parameters: ()
return_statement: return database
docstring: Returns a database of all registered engines. It loads the newest
      locations first, and returns as soon as a valid file is found.
docstring_summary: Returns a database of all registered engines. It loads the newest
      locations first, and returns as soon as a valid file is found.
docstring_tokens: Returns a database of all registered engines . It loads the newest locations first and returns as soon as a valid file is found .
function: def load_engines():
      """
      Returns a database of all registered engines. It loads the newest
      locations first, and returns as soon as a valid file is found.
      """
      database = {}
  
      # First try to load the newest files.
      for registry_path in paths_engine_database():
          try:
              if os.path.isfile(registry_path):
                  with open(registry_path, 'r', encoding="utf-8") as file:
                      database.update(json.loads(file.read()))
                      return database
          except Exception:
              pass
  
      # Load old engine data only if the newest data doesn't exist yet.
      for registry_path in paths_engine_database_old():
          try:
              if os.path.isfile(registry_path):
                  with open(registry_path, 'r', encoding="utf-8") as file:
                      database.update(json.loads(file.read()))
                      return database
          except Exception:
              pass
  
      return database
function_tokens: def load_engines ( ) : database = { } # First try to load the newest files. for registry_path in paths_engine_database ( ) : try : if os . path . isfile ( registry_path ) : with open ( registry_path , 'r' , encoding = "utf-8" ) as file : database . update ( json . loads ( file . read ( ) ) ) return database except Exception : pass # Load old engine data only if the newest data doesn't exist yet. for registry_path in paths_engine_database_old ( ) : try : if os . path . isfile ( registry_path ) : with open ( registry_path , 'r' , encoding = "utf-8" ) as file : database . update ( json . loads ( file . read ( ) ) ) return database except Exception : pass return database