From 4428fa28815d15adabc0f6d3d8a6070d9ecd72f1 Mon Sep 17 00:00:00 2001 From: Eduard Date: Mon, 23 Jun 2025 17:51:35 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9D=D0=B5=D0=BC=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=BE=D0=BF=D1=82=D0=B8=D0=BC=D0=B8=D0=B7=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BB=20=D0=B7=D0=B0=D0=BF=D1=80=D0=BE=D1=81=D1=8B?= =?UTF-8?q?=20=D0=BA=20=D0=B1=D0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- track.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/track.py b/track.py index 9b257e4..80570b7 100644 --- a/track.py +++ b/track.py @@ -94,18 +94,22 @@ def main(): logging.info(f"{Fore.YELLOW}Получение Типов деятельности{Fore.RESET}") activity_types = red.get_time_entry_activities() - - logging.info(f"{Fore.YELLOW}Сохранение Тегов{Fore.RESET}") - db.insert_tags(tags) - - logging.info(f"{Fore.YELLOW}Сохранение Задач Redmine{Fore.RESET}") - db.insert_tasks(issues) - - logging.info(f"{Fore.YELLOW}Сохранение Проектов Ветро{Fore.RESET}") - db.insert_vetro_projects(vetro_projects) - - logging.info(f"{Fore.YELLOW}Сохранение Типов деятелности{Fore.RESET}") - db.insert_activity_types(activity_types) +Опти + if tags: + logging.info(f"{Fore.YELLOW}Сохранение Тегов{Fore.RESET}") + db.insert_tags(tags) + + if issues: + logging.info(f"{Fore.YELLOW}Сохранение Задач Redmine{Fore.RESET}") + db.insert_tasks(issues) + + if vetro_projects: + logging.info(f"{Fore.YELLOW}Сохранение Проектов Ветро{Fore.RESET}") + db.insert_vetro_projects(vetro_projects) + + if activity_types: + logging.info(f"{Fore.YELLOW}Сохранение Типов деятелности{Fore.RESET}") + db.insert_activity_types(activity_types) except Exception as e: logger.error(Fore.RED + f"Ошибка при обновлении базы данных: {e}" + Fore.RESET) else: