Exemplo n.º 1
0
 def __init__(self, calendar_path):
     with open(calendar_path, 'r', encoding='UTF-8') as cal_file:
         try:
             cal_content = cal_file.readlines()
             self.calendar = iCalendar(cal_content)
         except Exception as e:
             raise InvalidCalendarFileException(message=str(e))
 def __init__(self, calendar_path):
     with open(calendar_path, 'r') as cal_file:
         try:
             cal_content = cal_file.readlines()
             self.calendar = iCalendar(cal_content)
         except Exception:
             raise InvalidCalendarFileException()
 def __init__(self, calendar_path):
     with open(calendar_path, 'r') as cal_file:
         try:
             cal_content = cal_file.readlines()
             self.calendar = iCalendar(cal_content)
         except Exception:
             raise InvalidCalendarFileException()
Exemplo n.º 4
0
 def __init__(self, calendar_path):
     with open(calendar_path, 'r', encoding='UTF-8') as cal_file:
         try:
             cal_content = cal_file.readlines()
             self.calendar = iCalendar(cal_content)
         except Exception as e:
             raise InvalidCalendarFileException(message=str(e))
Exemplo n.º 5
0
def cal(request):
    duration = timedelta(hours=3)
    cal = iCalendar()
    events = Event.objects.all()
    for event in events:
        if event.event_date is None or not event.status == u"Prêt":
            continue
        # TODO : add url
        time = arrow.get(event.event_date.replace(tzinfo=None), 'Europe/Brussels')
        e = iEvent(name=event.name.replace(',', '\,'), begin=time, duration=duration, location=event.place.replace(',', '\,'))
        cal.events.append(e)

    return HttpResponse(str(cal), content_type="text/calendar")
 def __init__(self, calendar_path):
     with open(calendar_path, 'r') as cal_file:
         cal_content = cal_file.readlines()
         self.calendar = iCalendar(cal_content)
Exemplo n.º 7
0
 def __init__(self, calendar_path):
     with open(calendar_path, 'r') as cal_file:
         cal_content = cal_file.readlines()
         self.calendar = iCalendar(cal_content)
Exemplo n.º 8
0
    def test_one_entity_one_attrib(self):

        ical = ics.iCalendar(source='assets/tests/one_entity_one_attr.ics')
        print(ical.parsed)
        self.assertEqual(ical.parsed['root']['VCALENDAR']['HELLO'], 'WORLD')