From d0bf0f5a2dc9e4eec389c8e703a09296baf44aa8 Mon Sep 17 00:00:00 2001 From: Faridik Date: Tue, 27 Sep 2022 21:31:24 +0300 Subject: [PATCH] =?UTF-8?q?=D0=BD=D0=BE=D0=B2=D1=8B=D0=B9=20=D1=84=D0=BE?= =?UTF-8?q?=D1=80=D0=BC=D0=B0=D1=82=20=D0=B4=D0=BB=D1=8F=20=D0=B2=D1=8B?= =?UTF-8?q?=D0=B2=D0=BE=D0=B4=D0=B0=20=D0=BE=D1=86=D0=B5=D0=BD=D0=BE=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GoogleService/manager/manager.py | 2 +- TelegramBot/messages/messages.py | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/GoogleService/manager/manager.py b/GoogleService/manager/manager.py index 0730a30..52fd182 100644 --- a/GoogleService/manager/manager.py +++ b/GoogleService/manager/manager.py @@ -263,7 +263,7 @@ class Manager: assignment_value = list(map(toFloat, assignment_values[student.number - 1])) notes_range, n_row = row[ASSIGNMENT_NOTES_RANGES].split(",") note = self.get_values(notes_range)[student.number - 1][int(n_row)] - note = "Замечаний по работе нет." if note == "-" else f"Замечания:\n{note}" + note = "" if note == "-" else f"Замечания:\n{note}" student.add_assignment( Assignment( name=row[ASSIGNMENT_NAMES], diff --git a/TelegramBot/messages/messages.py b/TelegramBot/messages/messages.py index b7f297b..9db7f2f 100644 --- a/TelegramBot/messages/messages.py +++ b/TelegramBot/messages/messages.py @@ -50,9 +50,16 @@ class Messages: + "\n" ) summary += f"Σ: {to_str(sum(assignment))}\n" + elif is_float == "s": + for item in range(0, len(assignment), n_cols): + summary += ( + " ".join(list(map(to_str, assignment[item : item + n_cols]))) + + "\n" + ) if deadline != "-": summary += f"\n🕚 Дедлайн: {deadline}\n" - summary += f"\n📝 {notes}" + if notes: + summary += f"\n📝 {notes}" return summary @staticmethod