[CalendarServer-changes] [6754] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Tue Jan 18 15:34:23 PST 2011


Revision: 6754
          http://trac.macosforge.org/projects/calendarserver/changeset/6754
Author:   sagen at apple.com
Date:     2011-01-18 15:34:15 -0800 (Tue, 18 Jan 2011)
Log Message:
-----------
When validating calendar data, use "native" DTSTART (i.e. date or datetime)

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/ical.py
    CalendarServer/trunk/twistedcaldav/test/test_icalendar.py

Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py	2011-01-18 19:36:52 UTC (rev 6753)
+++ CalendarServer/trunk/twistedcaldav/ical.py	2011-01-18 23:34:15 UTC (rev 6754)
@@ -1375,12 +1375,8 @@
                 # If they're not both date or both date-time, raise error
                 if (subcomponent.hasProperty("DTSTART") and
                     subcomponent.hasProperty("RRULE")):
-                    # dtValue may be datetime or date, or unicode in which case
-                    # we look at the length to see if it's datetime or date.
-                    dtValue = subcomponent.getProperty("DTSTART").value()
+                    dtValue = subcomponent.propertyNativeValue("DTSTART")
                     dtType = type(dtValue)
-                    if dtType is unicode:
-                        dtType = datetime.date if len(dtValue) == 8 else datetime.datetime
                     for rrule in subcomponent.properties("RRULE"):
                         indexedTokens = {}
                         indexedTokens.update([valuePart.split("=")

Modified: CalendarServer/trunk/twistedcaldav/test/test_icalendar.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_icalendar.py	2011-01-18 19:36:52 UTC (rev 6753)
+++ CalendarServer/trunk/twistedcaldav/test/test_icalendar.py	2011-01-18 23:34:15 UTC (rev 6754)
@@ -86,6 +86,7 @@
         CalDAV resource validation and fixing.
         """
         data = """BEGIN:VCALENDAR
+VERSION:2.0
 BEGIN:VTIMEZONE
 TZID:America/Los_Angeles
 BEGIN:DAYLIGHT
@@ -128,6 +129,7 @@
         calendar.validateComponentsForCalDAV(False, fix=False)
 
         data = """BEGIN:VCALENDAR
+VERSION:2.0
 BEGIN:VTIMEZONE
 TZID:America/Los_Angeles
 BEGIN:DAYLIGHT
@@ -150,7 +152,6 @@
 DTEND;VALUE=DATE:20110108
 DTSTAMP:20110106T231917Z
 RRULE:FREQ=DAILY;INTERVAL=1;UNTIL=20110131T123456
-TRANSP:TRANSPARENT
 SUMMARY:test
 CREATED:20110105T191945Z
 UID:5D70FD7E-3DFA-4981-8B91-E9E6CD5FCE28
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110118/da66dd37/attachment.html>


More information about the calendarserver-changes mailing list