def render(self):
     sdata = magicstring(ical_string(self.ical_event()))
     resp = magicstring(sdata)
     lresp = len(resp)
     self.request.response.setHeader('Content-Type','text/calendar')
     self.request.response.addHeader(
         "Content-Disposition","filename=%s.ics" % (
             self.context.getId()))
     self.request.response.setHeader('Content-Length', len(resp))
     self.request.response.write(resp)
Ejemplo n.º 2
0
 def render(self):
     events = []
     for i in self.items:
         event = i.getObject()
         icalv = event.restrictedTraverse('@@ical')
         events.append(icalv.ical_event())
     resp = magicstring(ical_string(events))
     self.request.response.setHeader('Content-Type','text/calendar')
     self.request.response.addHeader(
         "Content-Disposition","filename=%s.ics" % (
             self.context.getId()))
     self.request.response.setHeader('Content-Length', len(resp))
     self.request.response.write(resp)