From 29380539e55059fa2683c325fa74a2e3d158c129 Mon Sep 17 00:00:00 2001 From: Sergio Date: Sun, 12 Jan 2025 21:33:33 +0100 Subject: [PATCH] =?UTF-8?q?fix:=20fbneo=5Froms=5Fby=5Fmanucafcturer.py:fin?= =?UTF-8?q?d=5Fgames()=20error=20cuando=20la=20lista=20filtered=5Fgames=20?= =?UTF-8?q?est=C3=A1=20vac=C3=ADa=20y=20la=20funci=C3=B3n=20max()=20no=20t?= =?UTF-8?q?iene=20elementos=20para=20comparar.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- python/fbneo_roms_utils/fbneo_roms_by_manufacturer.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/python/fbneo_roms_utils/fbneo_roms_by_manufacturer.py b/python/fbneo_roms_utils/fbneo_roms_by_manufacturer.py index ac017a2..11ddfa3 100644 --- a/python/fbneo_roms_utils/fbneo_roms_by_manufacturer.py +++ b/python/fbneo_roms_utils/fbneo_roms_by_manufacturer.py @@ -176,6 +176,10 @@ def find_games(file, search_string): game_manufacturer = game.getElementsByTagName("manufacturer")[0] filtered_games.append((description.firstChild.data, game.getAttribute('name'), game_manufacturer.firstChild.data)) + if not filtered_games: + print(f"No se encontraron juegos que contengan '{search_string}'") + return + # Encuentra el ancho máximo para cada columna max_desc_length = max(len("Descripción"), max(len(row[0]) for row in filtered_games)) max_name_length = max(len("Nombre del archivo"), max(len(row[1] + '.zip') for row in filtered_games)) @@ -194,6 +198,7 @@ def find_games(file, search_string): # Imprime el pie de la tabla print(f"{'='*(max_desc_length+max_name_length+max_manufacturer_length+10)}") + def copy_games(file, args, all_games=False): """Copia los juegos según los criterios especificados""" if args.create_folder and not all_games: