Add exceptions feature
This commit is contained in:
parent
faa23b2fe7
commit
1f3e2a414d
@ -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(2021,5,24,0,0,0,0)],
|
||||||
[datetime.datetime(2020,11,20,0,0,0,0)],
|
[datetime.datetime(2020,11,20,0,0,0,0)],
|
||||||
[datetime.datetime(2020,11,27,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 of the schedule year
|
||||||
start_date = datetime.datetime(2020, 8, 28, 0, 0, 0, 0)
|
start_date = datetime.datetime(2020, 8, 28, 0, 0, 0, 0)
|
||||||
# End of the schedule year
|
# End of the schedule year
|
||||||
end_date = datetime.datetime(2021, 6, 22, 0, 0, 0, 0)
|
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
|
offset = 0
|
||||||
|
3
main.py
3
main.py
@ -41,6 +41,9 @@ while True:
|
|||||||
if current_date == vacation[0]:
|
if current_date == vacation[0]:
|
||||||
school = False
|
school = False
|
||||||
break
|
break
|
||||||
|
for exception in exceptions:
|
||||||
|
if exception[0] == current_date:
|
||||||
|
day = exception[1]
|
||||||
if not school:
|
if not school:
|
||||||
continue
|
continue
|
||||||
if current_date > end_date:
|
if current_date > end_date:
|
||||||
|
Loading…
Reference in New Issue
Block a user