parameters: (*engine_files, silent=False)
return_statement: return 0
docstring: Adds the collection of engines to the registered engines.
docstring_summary: Adds the collection of engines to the registered engines.
docstring_tokens: Adds the collection of engines to the registered engines .
function: def add_engines(*engine_files, silent=False):
      """
      Adds the collection of engines to the registered engines.
      """
      engine_registry = cryregistry.load_engines()
  
      # Delete orphaned engines first
      clean_engines()
  
      added = []
      for engine_file in engine_files:
          if os.path.splitext(engine_file)[1] != cryregistry.ENGINE_EXTENSION:
              continue
  
          engine = load_engine_file(engine_file)
          if not engine:
              error_engine_json_decode(engine_file, silent)
  
          info = engine['info']
          engine_id = info['id']
  
          engine_data = {'uri': os.path.abspath(engine_file), 'info': info}
          prev = engine_registry.setdefault(engine_id, engine_data)
          if prev is engine_data or prev != engine_data:
              engine_registry[engine_id] = engine_data
              added.append(engine_id)
  
      if added:
          return cryregistry.save_engines(
              engine_registry, register_action=True, silent=silent)
      return 0
function_tokens: def add_engines ( * engine_files , silent = False ) : engine_registry = cryregistry . load_engines ( ) # Delete orphaned engines first clean_engines ( ) added = [ ] for engine_file in engine_files : if os . path . splitext ( engine_file ) [ 1 ] != cryregistry . ENGINE_EXTENSION : continue engine = load_engine_file ( engine_file ) if not engine : error_engine_json_decode ( engine_file , silent ) info = engine [ 'info' ] engine_id = info [ 'id' ] engine_data = { 'uri' : os . path . abspath ( engine_file ) , 'info' : info } prev = engine_registry . setdefault ( engine_id , engine_data ) if prev is engine_data or prev != engine_data : engine_registry [ engine_id ] = engine_data added . append ( engine_id ) if added : return cryregistry . save_engines ( engine_registry , register_action = True , silent = silent ) return 0