diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index fc07d0d..98f15cd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: | diff --git a/matrix_reminder_bot/bot_commands.py b/matrix_reminder_bot/bot_commands.py index 33b6d1e..b1d4bf7 100644 --- a/matrix_reminder_bot/bot_commands.py +++ b/matrix_reminder_bot/bot_commands.py @@ -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 @@ -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}"*'