Beispiel #1
0
    def __init__(self, vevent, after, before, tz):
        self.summary = vevent.decoded('SUMMARY')
        dtstart = vevent.decoded('DTSTART')
        self.start = to_datetime(dtstart, tz)

        if 'DTEND' in vevent:
            dtend = vevent.decoded('DTEND')
            self.end = to_datetime(dtend, tz)
            self.duration = self.end - self.start

        elif 'DURATION' in vevent:
            self.duration = vevent.decoded('DURATION')
            self.end = self.start + self.duration

        if 'RRULE' in vevent:
            self.rrule = Rrule(vevent['RRULE'], self.start, after, before, tz)
Beispiel #2
0
 def __init__(self, start_date, tz):
     self.tz = tz
     self.days = OrderedDict()
     self.dates = []
     for offset in range(7):
         date = start_date + datetime.timedelta(days=offset)
         self.dates.append(to_datetime(date, tz))
         self.days[date] = []
Beispiel #3
0
    def __init__(self, vrecur, dtstart, after, before, tz):
        vrecur = copy(vrecur)

        if vrecur:
            if 'UNTIL' in vrecur:
                vrecur['UNTIL'] = [
                    to_datetime(vrecur['UNTIL'][0], tz).astimezone(pytz.utc)]
            self.dtstart = dtstart
            self.rr = rrulestr(
                vrecur.to_ical(), dtstart=self.dtstart).between(
                after, before, True)

        else:
            self.rr = []