From d0cd483b7384e2cd063018ea1c2d18fa93b00280 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Sat, 6 May 2023 18:25:00 +0300 Subject: [PATCH] auto-schedule-pro-v2: fix negative day shifts being interpreted as positive ones --- modules/auto-schedule-pro-v2/main.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/modules/auto-schedule-pro-v2/main.py b/modules/auto-schedule-pro-v2/main.py index 7484e74..0ae4eae 100644 --- a/modules/auto-schedule-pro-v2/main.py +++ b/modules/auto-schedule-pro-v2/main.py @@ -92,14 +92,17 @@ def process_arguments(args, base_day): preferences = {} for arg in args: - if arg[1:].isdigit(): - selected_day += int(arg[1:]) - continue - if arg[0] == "-": - preferences[arg[1:]] = False + if arg[1:].isdigit(): + selected_day -= int(arg[1:]) + else: + preferences[arg[1:]] = False + elif arg[0] == "+": - preferences[arg[1:]] = True + if arg[1:].isdigit(): + selected_day += int(arg[1:]) + else: + preferences[arg[1:]] = True selected_day = selected_day % 14