matplobbot-shared 0.1.29__tar.gz → 0.1.30__tar.gz

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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matplobbot-shared
3
- Version: 0.1.29
3
+ Version: 0.1.30
4
4
  Summary: Shared library for the Matplobbot ecosystem (database, services, i18n).
5
5
  Author: Ackrome
6
6
  Author-email: ivansergeyevich@gmail.com
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: matplobbot-shared
3
- Version: 0.1.29
3
+ Version: 0.1.30
4
4
  Summary: Shared library for the Matplobbot ecosystem (database, services, i18n).
5
5
  Author: Ackrome
6
6
  Author-email: ivansergeyevich@gmail.com
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="matplobbot-shared",
5
- version="0.1.29", # Let's use the version from your requirements.txt
5
+ version="0.1.30", # Let's use the version from your requirements.txt
6
6
  packages=find_packages(include=['shared_lib', 'shared_lib.*']),
7
7
  description="Shared library for the Matplobbot ecosystem (database, services, i18n).",
8
8
  author="Ackrome",
@@ -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
  )