From 1dbec9231b5226cdf88c193f35064147e73de6ce Mon Sep 17 00:00:00 2001 From: iziram Date: Mon, 10 Jul 2023 18:30:25 +0200 Subject: [PATCH] =?UTF-8?q?Assiduit=C3=A9s=20:=20Migration=20->=20date=20d?= =?UTF-8?q?ans=20les=20noms=20de=20fichiers=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/migrate_abs_to_assiduites.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/migrate_abs_to_assiduites.py b/tools/migrate_abs_to_assiduites.py index 21633820..5eb54371 100644 --- a/tools/migrate_abs_to_assiduites.py +++ b/tools/migrate_abs_to_assiduites.py @@ -362,11 +362,13 @@ def migrate_dept(dept_name: str, stats: _Statistics, time_elapsed: Profiler): print( f"{TerminalColor.RED}{statistiques['total']} absences qui n'ont pas pu être migrées." ) + + filename = f"/opt/scodoc-data/log/{datetime.now().strftime('%Y-%m-%dT%H:%M:%S')}scodoc_migration_abs_{dept_name}.json" print( - f"Vous retrouverez un fichier json {TerminalColor.GREEN}/opt/scodoc-data/log/scodoc_migration_abs_{dept_name}.json{TerminalColor.RED} contenant les problèmes de migrations" + f"Vous retrouverez un fichier json {TerminalColor.GREEN}{filename}{TerminalColor.RED} contenant les problèmes de migrations" ) with open( - f"/opt/scodoc-data/log/scodoc_migration_abs_{dept_name}.json", + filename, "w", encoding="utf-8", ) as file: