matplobbot-shared 0.1.32__tar.gz → 0.1.36__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.
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/PKG-INFO +1 -1
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/PKG-INFO +1 -1
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/setup.py +1 -1
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/database.py +2 -1
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/services/schedule_service.py +13 -5
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/README.md +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/SOURCES.txt +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/dependency_links.txt +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/requires.txt +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/top_level.txt +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/setup.cfg +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/__init__.py +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/i18n.py +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/redis_client.py +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/services/__init__.py +0 -0
- {matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/services/university_api.py +0 -0
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="matplobbot-shared",
|
|
5
|
-
version="0.1.
|
|
5
|
+
version="0.1.36", # 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",
|
|
@@ -108,11 +108,12 @@ async def init_db():
|
|
|
108
108
|
entity_id TEXT NOT NULL,
|
|
109
109
|
entity_name TEXT NOT NULL,
|
|
110
110
|
notification_time TIME NOT NULL,
|
|
111
|
-
last_schedule_hash TEXT,
|
|
112
111
|
is_active BOOLEAN DEFAULT TRUE,
|
|
112
|
+
last_schedule_hash TEXT, -- Added here for consistency
|
|
113
113
|
UNIQUE(user_id, entity_type, entity_id)
|
|
114
114
|
)
|
|
115
115
|
''')
|
|
116
|
+
# Add the last_schedule_hash column if it doesn't exist, for backward compatibility
|
|
116
117
|
logger.info("Database tables initialized.")
|
|
117
118
|
|
|
118
119
|
async def log_user_action(user_id: int, username: str | None, full_name: str, avatar_pic_url: str | None, action_type: str, action_details: str | None):
|
{matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/shared_lib/services/schedule_service.py
RENAMED
|
@@ -5,6 +5,7 @@ from datetime import datetime, date, time
|
|
|
5
5
|
from collections import defaultdict
|
|
6
6
|
from ics import Calendar, Event
|
|
7
7
|
from zoneinfo import ZoneInfo
|
|
8
|
+
from aiogram.utils.markdown import escape_md
|
|
8
9
|
|
|
9
10
|
from shared_lib.i18n import translator
|
|
10
11
|
|
|
@@ -40,19 +41,26 @@ def format_schedule(schedule_data: List[Dict[str, Any]], lang: str, entity_name:
|
|
|
40
41
|
|
|
41
42
|
formatted_lessons = []
|
|
42
43
|
for lesson in sorted(lessons, key=lambda x: x['beginLesson']):
|
|
44
|
+
# Escape all dynamic parts to prevent markdown parsing errors
|
|
45
|
+
discipline = escape_md(lesson['discipline'])
|
|
46
|
+
kind_of_work = escape_md(names_shorter[lesson['kindOfWork']])
|
|
47
|
+
lecturer = escape_md(lesson['lecturer_title'].replace('_',' '))
|
|
48
|
+
lecturer_email = escape_md(lesson.get('lecturerEmail', 'Почта не указана'))
|
|
49
|
+
group = escape_md(lesson.get('group', 'Группа не указана'))
|
|
50
|
+
|
|
43
51
|
lesson_details = [
|
|
44
52
|
f"`{lesson['beginLesson']} - {lesson['endLesson']} | {lesson['auditorium']}`",
|
|
45
|
-
f"{
|
|
53
|
+
f"{discipline} | {kind_of_work}"
|
|
46
54
|
]
|
|
47
55
|
|
|
48
56
|
if entity_type == 'group':
|
|
49
|
-
lesson_details.append(f"{
|
|
57
|
+
lesson_details.append(f"{lecturer}\n{lecturer_email}")
|
|
50
58
|
elif entity_type == 'person': # Lecturer
|
|
51
|
-
lesson_details.append(f" {
|
|
59
|
+
lesson_details.append(f" {group}")
|
|
52
60
|
elif entity_type == 'auditorium':
|
|
53
|
-
lesson_details.append(f"{
|
|
61
|
+
lesson_details.append(f"{group} | {lecturer}\n{lecturer_email}")
|
|
54
62
|
else: # Fallback to a generic format
|
|
55
|
-
lesson_details.append(f"{
|
|
63
|
+
lesson_details.append(f"{lecturer}")
|
|
56
64
|
|
|
57
65
|
formatted_lessons.append("\n".join(lesson_details))
|
|
58
66
|
|
|
File without changes
|
{matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
{matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/requires.txt
RENAMED
|
File without changes
|
{matplobbot_shared-0.1.32 → matplobbot_shared-0.1.36}/matplobbot_shared.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|