From 3bb1aee4b4fc011b613bebc2d8fabeb9be2dee36 Mon Sep 17 00:00:00 2001 From: fanilo Date: Wed, 31 Dec 2025 09:23:54 +0100 Subject: [PATCH] Refactored files structures --- cleaner.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 cleaner.py diff --git a/cleaner.py b/cleaner.py deleted file mode 100644 index 49a9956..0000000 --- a/cleaner.py +++ /dev/null @@ -1,33 +0,0 @@ -from pathlib import Path - -def supprimer_lignes_logger(fichier: str) -> None: - path = Path(fichier) - - lignes_filtrees = [] - skip_block = False - parentheses_balance = 0 - - with path.open("r", encoding="utf-8") as f: - for ligne in f: - stripped = ligne.lstrip() - - # Détection du début d'un appel logger - if not skip_block and stripped.startswith("logger"): - skip_block = True - parentheses_balance += ligne.count("(") - ligne.count(")") - continue - - if skip_block: - parentheses_balance += ligne.count("(") - ligne.count(")") - if parentheses_balance <= 0: - skip_block = False - parentheses_balance = 0 - continue - - lignes_filtrees.append(ligne) - - path.write_text("".join(lignes_filtrees), encoding="utf-8") - - -if __name__ == "__main__": - supprimer_lignes_logger("sage_connector.py")