From 5338cae63462fc461ab93badf752831fc5e583da Mon Sep 17 00:00:00 2001 From: skymike03 Date: Sun, 6 Jul 2025 21:03:51 +0200 Subject: [PATCH] Gestion d'erreur pour gamelist.xml dans update_gamelist.py --- update_gamelist.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/update_gamelist.py b/update_gamelist.py index 8625aab..f73d339 100644 --- a/update_gamelist.py +++ b/update_gamelist.py @@ -73,6 +73,15 @@ def update_gamelist(): except Exception as e: logger.error(f"Erreur lors de la mise à jour de {GAMELIST_FILE}: {e}") raise + +def load_gamelist(path): + """Charge le fichier gamelist.xml.""" + try: + tree = ET.parse(path) + return tree.getroot() + except (FileNotFoundError, ET.ParseError) as e: + logging.error(f"Erreur lors de la lecture de {path} : {e}") + return None if __name__ == "__main__": update_gamelist() \ No newline at end of file