сделал ревью системы
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2026-04-28 22:13:47 +10:00
parent c564140428
commit 25f2c09064
18 changed files with 1169 additions and 712 deletions

25
utils/helpers.py Normal file
View File

@@ -0,0 +1,25 @@
"""
Общие вспомогательные функции
"""
from datetime import datetime as dt
def create_folder(num: int) -> str:
"""
Форматирует номер дня/месяца для имени папки (добавляет ведущий ноль)
"""
if int(num) // 10 == 0:
return f"0{num}"
else:
return str(num)
def get_current_date_parts() -> tuple[str, str, str]:
"""
Возвращает текущую дату в формате (год, месяц, день) с форматированием
"""
datetime_now = dt.now()
current_day = create_folder(datetime_now.day)
current_month = create_folder(datetime_now.month)
current_year = f"{datetime_now.year}"
return current_year, current_month, current_day