format Black

This commit is contained in:
Rykov7
2023-02-22 18:53:12 +03:00
parent 23a93b5dbd
commit d0cf0762c8
13 changed files with 356 additions and 205 deletions
+10 -10
View File
@@ -15,28 +15,28 @@ def scheduler():
time.sleep(300)
@repeat(every().day.at('07:00'), PYTHONCHATRU, None)
@repeat(every().day.at("07:00"), PYTHONCHATRU, None)
def remind(chat_to_repeat, today):
""" Remind holiday. """
"""Remind holiday."""
if not today:
today = dt.today()
with open('holidays.csv', newline='', encoding='utf-8') as holidays_file:
with open("holidays.csv", newline="", encoding="utf-8") as holidays_file:
holidays = tuple(csv.reader(holidays_file))[1:]
for entry in holidays:
date, holiday, description = entry
if today.year % 4 == 0 and holiday == 'День программиста':
date = '09-12-1000' # instead of 09-13-1000 in non-leap-year
if today.year % 4 == 0 and holiday == "День программиста":
date = "09-12-1000" # instead of 09-13-1000 in non-leap-year
date = dt.strptime(date, "%m-%d-%Y")
if today.month == date.month and today.day == date.day:
notification = f'🎉 Сегодня <b><u>{holiday.upper()}</u></b>!\
\n\n{description}.'
notification = f"🎉 Сегодня <b><u>{holiday.upper()}</u></b>!\
\n\n{description}."
if date.year != 1000:
age = today.year - date.year
notification += f'\n\n🥳 <i>{age}-ая годовщина</i>'
notification += f"\n\n🥳 <i>{age}-ая годовщина</i>"
bot.send_message(chat_to_repeat, notification)
@repeat(every().day.at('06:00'), PYTHONCHATRU)
@repeat(every().day.at("06:00"), PYTHONCHATRU)
def stat_report(chat_to_repeat):
rep = report.create_report_text(PYTHONCHATRU)
if rep:
@@ -48,7 +48,7 @@ def print_get_jobs():
all_jobs = get_jobs()
text = f"├ <b>Jobs:</b> {str(len(all_jobs))}\
\n├ {dt.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n"
text += '<i>' + str(all_jobs) + '</i>'
text += "<i>" + str(all_jobs) + "</i>"
return text