Skip to content

Commit

Permalink
Merge branch 'master' into HarHarLinks/list-firing-alarms
Browse files Browse the repository at this point in the history
  • Loading branch information
HarHarLinks authored Feb 19, 2024
2 parents 8c61201 + 0c39919 commit 626eca1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,16 @@ jobs:

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.11
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U isort==5.12.0 flake8==6.1.0 flake8-comprehensions==3.14.0 black==23.9.1
pip install -U -e ".[dev]"
- name: Check import statement sorting
run: |
Expand Down
8 changes: 6 additions & 2 deletions matrix_reminder_bot/bot_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,6 @@ async def _list_reminders(self):
# Print the duration before (next) execution
next_execution = reminder.job.next_run_time
next_execution = arrow.get(next_execution)

# One-time reminders
if isinstance(reminder.job.trigger, DateTrigger):
# Just print when the reminder will go off
Expand All @@ -488,7 +487,12 @@ async def _list_reminders(self):
# Cron-based reminders
elif isinstance(reminder.job.trigger, CronTrigger):
# A human-readable cron tab, in addition to the actual tab
line += f"{prettify_cron(reminder.cron_tab)} (`{reminder.cron_tab}`); next run {next_execution.humanize()}"
human_cron = prettify_cron(reminder.cron_tab)
if human_cron != reminder.cron_tab:
line += f"{human_cron} (`{reminder.cron_tab}`)"
else:
line += f"`Every {reminder.cron_tab}`"
line += f"; next run {next_execution.humanize()}"

# Add the reminder's text
line += f'; *"{reminder.reminder_text}"*'
Expand Down

0 comments on commit 626eca1

Please sign in to comment.