From 1f3e2a414d29ccaae01c936a14acab353c042ac0 Mon Sep 17 00:00:00 2001 From: DogeyStamp Date: Thu, 22 Apr 2021 19:10:38 -0400 Subject: [PATCH] Add exceptions feature --- docs/config.py | 6 +++++- main.py | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/config.py b/docs/config.py index d369aab..995f6f4 100644 --- a/docs/config.py +++ b/docs/config.py @@ -61,9 +61,13 @@ vacation_days = [[datetime.datetime(2020,9,7,0,0,0,0)], [datetime.datetime(2021,5,24,0,0,0,0)], [datetime.datetime(2020,11,20,0,0,0,0)], [datetime.datetime(2020,11,27,0,0,0,0)]] +# In the event you need to completely disrupt the cycle, add an exception +exceptions = [ + [datetime.datetime(2021,4,22,0,0,0,0),3], + [datetime.datetime(2021,4,23,0,0,0,0),1]] # Start of the schedule year start_date = datetime.datetime(2020, 8, 28, 0, 0, 0, 0) # End of the schedule year end_date = datetime.datetime(2021, 6, 22, 0, 0, 0, 0) -#in case you're too lazy to modify the start date or vacation days +# In case you're too lazy to modify the start date or vacation days offset = 0 diff --git a/main.py b/main.py index 5c313ed..6379183 100644 --- a/main.py +++ b/main.py @@ -41,6 +41,9 @@ while True: if current_date == vacation[0]: school = False break + for exception in exceptions: + if exception[0] == current_date: + day = exception[1] if not school: continue if current_date > end_date: