style(edu): ruff-format webinar-checker/checker.py
ci / lint-prettier (push) Successful in 13s
ci / lint-ruff (push) Successful in 4s
ci / lint-yaml (push) Successful in 7s
ci / lint-dockerfiles (push) Successful in 5s
ci / validate (push) Successful in 6s
ci / build (push) Has been skipped
ci / deploy-userbot-panel (push) Has been skipped
ci / lint-prettier (push) Successful in 13s
ci / lint-ruff (push) Successful in 4s
ci / lint-yaml (push) Successful in 7s
ci / lint-dockerfiles (push) Successful in 5s
ci / validate (push) Successful in 6s
ci / build (push) Has been skipped
ci / deploy-userbot-panel (push) Has been skipped
This commit is contained in:
@@ -689,17 +689,31 @@ def get_schedule_day_keyboard(user_id: int | None = None):
|
||||
),
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(_tr(lang, short_keys[0]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[0]}'),
|
||||
InlineKeyboardButton(_tr(lang, short_keys[1]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[1]}'),
|
||||
InlineKeyboardButton(_tr(lang, short_keys[2]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[2]}'),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[0]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[0]}'
|
||||
),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[1]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[1]}'
|
||||
),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[2]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[2]}'
|
||||
),
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(_tr(lang, short_keys[3]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[3]}'),
|
||||
InlineKeyboardButton(_tr(lang, short_keys[4]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[4]}'),
|
||||
InlineKeyboardButton(_tr(lang, short_keys[5]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[5]}'),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[3]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[3]}'
|
||||
),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[4]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[4]}'
|
||||
),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[5]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[5]}'
|
||||
),
|
||||
],
|
||||
[
|
||||
InlineKeyboardButton(_tr(lang, short_keys[6]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[6]}'),
|
||||
InlineKeyboardButton(
|
||||
_tr(lang, short_keys[6]), callback_data=f'schedule_day_{SCHEDULE_WEEKDAYS_CANONICAL[6]}'
|
||||
),
|
||||
],
|
||||
]
|
||||
return InlineKeyboardMarkup(keyboard)
|
||||
@@ -747,7 +761,16 @@ def _parse_schedule_cell(cell_html: str) -> list:
|
||||
note = ''
|
||||
teacher = ''
|
||||
for line in lines[1:]:
|
||||
if line in ('вебінар', 'онлайн', 'асинхрон', 'асинхронно') or 'Вебінар' in line or 'Асинхронн' in line or 'вебінар' in line.lower() or 'онлайн' in line.lower() or 'асинхрон' in line.lower() or 'А/С урок' in line or 'Онлайн' in line:
|
||||
if (
|
||||
line in ('вебінар', 'онлайн', 'асинхрон', 'асинхронно')
|
||||
or 'Вебінар' in line
|
||||
or 'Асинхронн' in line
|
||||
or 'вебінар' in line.lower()
|
||||
or 'онлайн' in line.lower()
|
||||
or 'асинхрон' in line.lower()
|
||||
or 'А/С урок' in line
|
||||
or 'Онлайн' in line
|
||||
):
|
||||
note = line
|
||||
else:
|
||||
teacher = line
|
||||
@@ -1510,7 +1533,12 @@ async def check_webinars_job(context: ContextTypes.DEFAULT_TYPE):
|
||||
# Build message in user's language
|
||||
# sub_id comes from redis set as string, convert to int for translation lookup
|
||||
webinar_items = '\n\n'.join(
|
||||
[t_chat(int(sub_id), int(sub_id), 'webinar_item', name=escape(w['name']), url=escape(w['url'])) for w in new_webinars]
|
||||
[
|
||||
t_chat(
|
||||
int(sub_id), int(sub_id), 'webinar_item', name=escape(w['name']), url=escape(w['url'])
|
||||
)
|
||||
for w in new_webinars
|
||||
]
|
||||
)
|
||||
message = t_chat(int(sub_id), int(sub_id), 'webinar_found') + webinar_items
|
||||
|
||||
|
||||
Reference in New Issue
Block a user