Frederic De Groef avatar Frederic De Groef committed e327349

Added a unique UID to ical events.

Comments (0)

Files changed (1)

src/gehol/converters/rfc5545icalwriter.py

 
         for event in self.events:
             write_line(out, "BEGIN:VEVENT")
+            write_line(out, "UID:%s" % self.make_uid(event))
             write_line(out, "DTSTAMP:%s" %  event.dtstart.strftime("%Y%m%dT%H%M%S"))
             write_line(out, "DTSTART;TZID=Europe/Brussels:%s" % event.dtstart.strftime("%Y%m%dT%H%M%S"))
             write_line(out, "DTEND;TZID=Europe/Brussels:%s" % event.dtend.strftime("%Y%m%dT%H%M%S"))
             write_line(out, "DESCRIPTION:%s" % event.description)
             write_line(out, "LOCATION:%s" % event.location)
             write_line(out, "ORGANIZER:%s" % event.organizer)
-            #write_line(out, "GEO:5.092867;51.557655")
             write_line(out, "END:VEVENT")
 
 
         return ical_string.encode('utf-8')
 
 
+    def make_uid(self, event):
+        t =  event.dtstart.strftime("%Y%m%dT%H%M%S")
+        n = self.name
+        return "%s%s@%s" % (t, n, "geholimport.appspot.com")
+
+
+
 
 def convert_geholcalendar_to_ical(gehol_calendar, first_monday):
     date_init = datetime.strptime(first_monday,'%d/%m/%Y')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.