From 6f5c39c63807960319b1528ea30b4a2a22b63795 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sat, 8 Apr 2023 14:52:32 +0300 Subject: [PATCH] dt format --- entrypoint.py | 2 ++ helpers/alice.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/entrypoint.py b/entrypoint.py index 8b7c5ce..3c0b441 100644 --- a/entrypoint.py +++ b/entrypoint.py @@ -6,9 +6,11 @@ from daemons.api import api from daemons.bot import bot from daemons.fetch import fetch from daemons.notify import notify +import locale logging.config.dictConfig(settings.logging_config) +locale.setlocale(locale.LC_TIME, 'ru_RU.UTF-8') arg = sys.argv[-1] if arg == "bot": diff --git a/helpers/alice.py b/helpers/alice.py index 433f690..6f351a2 100644 --- a/helpers/alice.py +++ b/helpers/alice.py @@ -38,7 +38,7 @@ class Processor: "end_session": True } return { - "text": f"Твое ближайшее занятие {str(lesson['begin'])}: {lesson['discipline']}", + "text": f'Твое ближайшее занятие {lesson["begin"].strftime("%d %B %H:%M")}: {lesson["discipline"]}', "end_session": True } else: @@ -63,6 +63,6 @@ class Processor: "end_session": True } return { - "text": f"Отлично, теперь я могу подсказывать тебе расписание. Твое ближайшее занятие {lesson['begin']}: {lesson['discipline']}", + "text": f'Отлично, теперь я могу подсказывать тебе расписание. Твое ближайшее занятие {lesson["begin"].strftime("%d %B %H:%M")}: {lesson["discipline"]}', "end_session": True } \ No newline at end of file