in src/pycalendar/icalendar/recurrence.py [0:0]
def generateMonthlySet(self, start, items):
# Cannot have BYYEARDAY and BYWEEKNO
# Start with initial date-time
items.append(start.duplicate())
if (self.mByMonth is not None) and (len(self.mByMonth) != 0):
# BYMONTH limits the range of possible values
items[:] = self.byMonthLimit(items)
if (len(items) == 0):
return
# No BYWEEKNO
# No BYYEARDAY
if (self.mByMonthDay is not None) and (len(self.mByMonthDay) != 0):
items[:] = self.byMonthDayExpand(items)
if (self.mByDay is not None) and (len(self.mByDay) != 0):
# BYDAY is complicated:
# if BYDAY is included with BYYEARDAY or BYMONTHDAY then it
# contracts the recurrence set
# else it expands it, but the expansion depends on the frequency
# and other BYxxx periodicities
if ((self.mByYearDay is not None) and (len(self.mByYearDay) != 0)) \
or ((self.mByMonthDay is not None) and (len(self.mByMonthDay) != 0)):
items[:] = self.byDayLimit(items)
else:
items[:] = self.byDayExpandMonthly(items)
if ((self.mByHours is not None) and (len(self.mByHours) != 0)):
items[:] = self.byHourExpand(items)
if ((self.mByMinutes is not None) and (len(self.mByMinutes) != 0)):
items[:] = self.byMinuteExpand(items)
if ((self.mBySeconds is not None) and (len(self.mBySeconds) != 0)):
items[:] = self.bySecondExpand(items)
# Remove invalid items before BYSETPOS
items[:] = filter(lambda x: not x.invalid(), items)
if ((self.mBySetPos is not None) and (len(self.mBySetPos) != 0)):
items[:] = self.bySetPosLimit(items)