matplobbot-shared 0.1.29__py3-none-any.whl → 0.1.30__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of matplobbot-shared might be problematic. Click here for more details.
- {matplobbot_shared-0.1.29.dist-info → matplobbot_shared-0.1.30.dist-info}/METADATA +1 -1
- {matplobbot_shared-0.1.29.dist-info → matplobbot_shared-0.1.30.dist-info}/RECORD +5 -5
- shared_lib/services/schedule_service.py +16 -4
- {matplobbot_shared-0.1.29.dist-info → matplobbot_shared-0.1.30.dist-info}/WHEEL +0 -0
- {matplobbot_shared-0.1.29.dist-info → matplobbot_shared-0.1.30.dist-info}/top_level.txt +0 -0
|
@@ -2,9 +2,9 @@ shared_lib/__init__.py,sha256=Wxuw1wbvCOsKqs6WfIQ05cx_vndhPs6rH2krMatFRqA,45
|
|
|
2
2
|
shared_lib/database.py,sha256=vGiCxk1m_xZxaJQtjQPC_7G2Wxnu-ptWx5Z7q_XDIGs,20706
|
|
3
3
|
shared_lib/i18n.py,sha256=VBWQWVF-k_HDiidYo_RUPyUCM7oL897z5hOw9jvOoYY,1762
|
|
4
4
|
shared_lib/services/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
5
|
-
shared_lib/services/schedule_service.py,sha256=
|
|
5
|
+
shared_lib/services/schedule_service.py,sha256=l4kffo866Pzj-rVNqAL-vMVYhB-Arfgl_bzwnNIVA9M,2441
|
|
6
6
|
shared_lib/services/university_api.py,sha256=Ui-zjfKOHCCf2Imh8CNtVOWegwuep7IB8gO9IKNUrrE,1898
|
|
7
|
-
matplobbot_shared-0.1.
|
|
8
|
-
matplobbot_shared-0.1.
|
|
9
|
-
matplobbot_shared-0.1.
|
|
10
|
-
matplobbot_shared-0.1.
|
|
7
|
+
matplobbot_shared-0.1.30.dist-info/METADATA,sha256=i0itMsVkSh3YoPt8uMPoifKOXd5DgXBTc9alPnT6ez0,395
|
|
8
|
+
matplobbot_shared-0.1.30.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
9
|
+
matplobbot_shared-0.1.30.dist-info/top_level.txt,sha256=L8mrC50YWCe19jmh_zrUZFvXSkhsnES5K6y027G1838,11
|
|
10
|
+
matplobbot_shared-0.1.30.dist-info/RECORD,,
|
|
@@ -2,6 +2,18 @@
|
|
|
2
2
|
|
|
3
3
|
from typing import List, Dict, Any
|
|
4
4
|
from datetime import datetime, date
|
|
5
|
+
from collections import defaultdict
|
|
6
|
+
|
|
7
|
+
names_shorter = defaultdict(lambda: 'Неизвестно')
|
|
8
|
+
to_add = {
|
|
9
|
+
'Практические (семинарские) занятия': 'Семинар',
|
|
10
|
+
'Лекции': 'Лекция',
|
|
11
|
+
'Консультации текущие': 'Консультация',
|
|
12
|
+
'Повторная промежуточная аттестация (экзамен)':'Пересдача'
|
|
13
|
+
}
|
|
14
|
+
names_shorter.update(to_add)
|
|
15
|
+
|
|
16
|
+
|
|
5
17
|
|
|
6
18
|
def format_schedule(schedule_data: List[Dict[str, Any]], lang: str, entity_name: str, start_date: date) -> str:
|
|
7
19
|
"""Formats a list of lessons into a readable daily schedule."""
|
|
@@ -26,10 +38,10 @@ def format_schedule(schedule_data: List[Dict[str, Any]], lang: str, entity_name:
|
|
|
26
38
|
formatted_lessons = []
|
|
27
39
|
for lesson in sorted(lessons, key=lambda x: x['beginLesson']):
|
|
28
40
|
formatted_lessons.append(
|
|
29
|
-
f"`{lesson['beginLesson']} - {lesson['endLesson']}`\n"
|
|
30
|
-
f"{lesson['discipline']}\n"
|
|
31
|
-
f"{lesson['kindOfWork']}\n"
|
|
32
|
-
f"{lesson['auditorium']} ({lesson['building']})\n"
|
|
41
|
+
f"`{lesson['beginLesson']} - {lesson['endLesson']} | {lesson['auditorium']}`\n"
|
|
42
|
+
f"{lesson['discipline']} | {names_shorter[lesson['kindOfWork']]}\n"
|
|
43
|
+
# f"{lesson['kindOfWork']}\n"
|
|
44
|
+
# f"{lesson['auditorium']} ({lesson['building']})\n"
|
|
33
45
|
f"{lesson['lecturer_title'].replace('_',' ')}\n"
|
|
34
46
|
f"{lesson['lecturerEmail']}\n"
|
|
35
47
|
)
|
|
File without changes
|
|
File without changes
|