def repeat(self, day=None):
if day is None:<EOL><INDENT>day = self.day<EOL><DEDENT>try:<EOL><INDENT>d = date(self.year, self.month, day)<EOL><DEDENT>except ValueError:  <EOL><INDENT>return self.count<EOL><DEDENT>if self.count_first and d <= self.end_repeat:<EOL><INDENT>self.count_it(d.day)<EOL><DEDENT>d += timedelta(days=self.num)<EOL>if self.end_on is not None:<EOL><INDENT>while d.month == self.month andd <= self.end_repeat andd.day <= self.end_on:<EOL><INDENT>self.count_it(d.day)<EOL>d += timedelta(days=self.num)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>while d.month == self.month and d <= self.end_repeat:<EOL><INDENT>self.count_it(d.day)<EOL>d += timedelta(days=self.num)<EOL><DEDENT><DEDENT>
Add 'num' to the day and count that day until we reach end_repeat, or
until we're outside of the current month, counting the days
as we go along.