Exemplo n.º 1
0
def timetable_for_friday():
    timetable = load_timetable()
    week = load_week()

    if today.weekday() > 4:
        week = change_week(week)

    timetable = timetable[week]

    return prepare_message(timetable['friday'])
def timetable_for_today():
    timetable = load_timetable()
    week = load_week()
    today = get_week_day_name()

    timetable = timetable[week]

    if today in timetable:
        return prepare_message(timetable[today])

    return 'Сегодня, к сожалению (или к счастью), нет пар'
def timetable_for_next_week():
    timetable = load_timetable()
    week = change_week(load_week())

    message = ''
    timetable = timetable[week]
    for day in timetable:
        message += translate_day(day) + ':\n\n' + prepare_message(timetable[day]) + \
            '----------------------------------\n\n'

    return message
Exemplo n.º 4
0
def timetable_for_tomorrow():
    timetable = load_timetable()
    week = load_week()

    if get_week_day_name() == 'sunday':
        week = change_week(week)

    timetable = timetable[week]
    tomorrow = get_week_day_name(1)

    if tomorrow in timetable:
        return prepare_message(timetable[tomorrow])

    return 'Завтра, к сожалению (или к счастью), нет пар'
Exemplo n.º 5
0
def timetable_for_day_after_tomorrow():
    timetable = load_timetable()
    week = load_week()
    today = get_week_day_name()

    if today == 'saturday' or today == 'sunday':
        week = change_week(week)

    timetable = timetable[week]
    day_after_tomorrow = get_week_day_name(2)

    if day_after_tomorrow in timetable:
        return prepare_message(timetable[day_after_tomorrow])

    return 'Послезавтра, к сожалению (или к счастью), нет пар'