happenings/utils/handlers.py
def _handle_weekly_repeat_in(self):
        """
        Handles repeating both weekly and biweekly events, if the
        current year and month are inside it's l_start_date and l_end_date.
        Four possibilites:
            1. The event starts this month and ends repeating this month.
            2. The event starts this month and doesn't finish repeating
            this month.
            3. The event didn't start this month but ends repeating this month.
            4. The event didn't start this month and doesn't end repeating
            this month.
        """
        self.day = self.event.l_start_date.day
        self.count_first = False
        repeats = {'WEEKLY': 7, 'BIWEEKLY': 14}
        if self.event.starts_same_year_month_as(self.year, self.month):
            # This takes care of 1 and 2 above.
            # Note that 'count' isn't incremented before adding a week (in
            # Repeater.repeat()), b/c it's assumed that l_start_date
            # was already counted.
            for repeat, num in repeats.items():
                self.num = num
                if self.event.repeats(repeat):
                    self.repeat()
                    if self.event.is_chunk():
                        self.repeat_chunk(diff=self.event.start_end_diff)
def _handle_weekly_repeat_in(self):
        """
        Handles repeating both weekly and biweekly events, if the
        current year and month are inside it's l_start_date and l_end_date.
        Four possibilites:
            1. The event starts this month and ends repeating this month.
            2. The event starts this month and doesn't finish repeating
            this month.
            3. The event didn't start this month but ends repeating this month.
            4. The event didn't start this month and doesn't end repeating
            this month.
        """
        self.day = self.event.l_start_date.day
        self.count_first = False
        repeats = {'WEEKLY': 7, 'BIWEEKLY': 14}
        if self.event.starts_same_year_month_as(self.year, self.month):
            # This takes care of 1 and 2 above.
            # Note that 'count' isn't incremented before adding a week (in
            # Repeater.repeat()), b/c it's assumed that l_start_date
            # was already counted.
            for repeat, num in repeats.items():
                self.num = num
                if self.event.repeats(repeat):
                    self.repeat()
                    if self.event.is_chunk():
                        self.repeat_chunk(diff=self.event.start_end_diff)
Handles repeating both weekly and biweekly events, if the
        current year and month are inside it's l_start_date and l_end_date.
        Four possibilites:
            1. The event starts this month and ends repeating this month.
            2. The event starts this month and doesn't finish repeating
            this month.
            3. The event didn't start this month but ends repeating this month.
            4. The event didn't start this month and doesn't end repeating
            this month.