|
@ -36,6 +36,7 @@ from typing import ( |
|
|
Literal, |
|
|
Literal, |
|
|
List, |
|
|
List, |
|
|
) |
|
|
) |
|
|
|
|
|
from functools import partial |
|
|
|
|
|
|
|
|
from .asset import Asset |
|
|
from .asset import Asset |
|
|
from .enums import ( |
|
|
from .enums import ( |
|
@ -335,10 +336,29 @@ class ScheduledEventRecurrenceRule: |
|
|
if end is not None: |
|
|
if end is not None: |
|
|
self._end = parse_time(end) |
|
|
self._end = parse_time(end) |
|
|
|
|
|
|
|
|
end = data.get('end') |
|
|
wd_conv = partial(try_enum, ScheduledEventRecurrenceWeekday) |
|
|
if end is not None: |
|
|
|
|
|
self._end = parse_time(end) |
|
|
raw_weekdays = data.get('by_weekday') |
|
|
# TODO: finish this impl |
|
|
if raw_weekdays is not None: |
|
|
|
|
|
self._weekdays = list(map(wd_conv, raw_weekdays)) |
|
|
|
|
|
|
|
|
|
|
|
raw_n_weekdays = data.get('by_n_weekday') |
|
|
|
|
|
if raw_n_weekdays is not None: |
|
|
|
|
|
self._n_weekdays = [_NWeekday(n['n'], wd_conv(n['day'])) for n in raw_n_weekdays] |
|
|
|
|
|
|
|
|
|
|
|
raw_months = data.get('by_month') |
|
|
|
|
|
raw_month_days = data.get('by_month_day') |
|
|
|
|
|
|
|
|
|
|
|
if raw_months is not None and raw_month_days is not None: |
|
|
|
|
|
self._month_days = [ |
|
|
|
|
|
date( |
|
|
|
|
|
1900, # Using this as a placeholder year, ignored anyways |
|
|
|
|
|
month, |
|
|
|
|
|
day, |
|
|
|
|
|
) |
|
|
|
|
|
for month, day in zip(raw_months, raw_month_days) |
|
|
|
|
|
] |
|
|
|
|
|
|
|
|
return self |
|
|
return self |
|
|
|
|
|
|
|
|
|
|
|
|
|
|