[CalendarServer-changes] [5205] CalendarServer/trunk/twistedcaldav
source_changes at macosforge.org
source_changes at macosforge.org
Wed Feb 24 20:26:04 PST 2010
Revision: 5205
http://trac.macosforge.org/projects/calendarserver/changeset/5205
Author: wsanchez at apple.com
Date: 2010-02-24 20:26:03 -0800 (Wed, 24 Feb 2010)
Log Message:
-----------
Use asUTC()
Modified Paths:
--------------
CalendarServer/trunk/twistedcaldav/dateops.py
CalendarServer/trunk/twistedcaldav/ical.py
CalendarServer/trunk/twistedcaldav/scheduling/icaldiff.py
CalendarServer/trunk/twistedcaldav/scheduling/itip.py
Modified: CalendarServer/trunk/twistedcaldav/dateops.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/dateops.py 2010-02-25 04:25:36 UTC (rev 5204)
+++ CalendarServer/trunk/twistedcaldav/dateops.py 2010-02-25 04:26:03 UTC (rev 5205)
@@ -20,7 +20,6 @@
__all__ = [
"normalizeStartEndDuration",
- "normalizeToUTC",
"normalizeForIndex",
"floatoffset",
"compareDateTime",
Modified: CalendarServer/trunk/twistedcaldav/ical.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/ical.py 2010-02-25 04:25:36 UTC (rev 5204)
+++ CalendarServer/trunk/twistedcaldav/ical.py 2010-02-25 04:26:03 UTC (rev 5205)
@@ -46,9 +46,10 @@
from twext.web2.stream import IStream
from twext.python.log import Logger
+from twext.python.datetime import asUTC, iCalendarString
-from twistedcaldav.dateops import compareDateTime, normalizeToUTC, timeRangesOverlap,\
- normalizeStartEndDuration, toString, normalizeForIndex, differenceDateTime
+from twistedcaldav.dateops import compareDateTime, timeRangesOverlap,\
+ normalizeStartEndDuration, normalizeForIndex, differenceDateTime
from twistedcaldav.instance import InstanceList
from twistedcaldav.scheduling.cuaddress import normalizeCUAddr
@@ -623,7 +624,7 @@
"""
dtstart = self.propertyNativeValue("DTSTART")
if dtstart is not None:
- return normalizeToUTC(dtstart)
+ return asUTC(dtstart)
else:
return None
@@ -643,7 +644,7 @@
dtend = dtstart + duration
if dtend is not None:
- return normalizeToUTC(dtend)
+ return asUTC(dtend)
else:
return None
@@ -662,7 +663,7 @@
due = dtstart + duration
if due is not None:
- return normalizeToUTC(due)
+ return asUTC(due)
else:
return None
@@ -675,7 +676,7 @@
rid = self.propertyNativeValue("RECURRENCE-ID")
if rid is not None:
- return normalizeToUTC(rid)
+ return asUTC(rid)
else:
return None
@@ -1104,7 +1105,7 @@
# Check whether recurrence-id matches an RDATE - if so it is OK
rdates = set()
for rdate in master.properties("RDATE"):
- rdates.update([normalizeToUTC(item) for item in rdate.value()])
+ rdates.update([asUTC(item) for item in rdate.value()])
if rid not in rdates:
# Check whether we have a truncated RRULE
rrules = master.properties("RRULE")
@@ -2033,7 +2034,7 @@
exdates = self.properties("EXDATE")
for exdate in exdates:
- exdate.setValue([normalizeToUTC(value) for value in exdate.value()])
+ exdate.setValue([asUTC(value) for value in exdate.value()])
try:
del exdate.params()["TZID"]
except KeyError:
@@ -2041,7 +2042,7 @@
rid = self.getProperty("RECURRENCE-ID")
if rid is not None:
- rid.setValue(normalizeToUTC(rid.value()))
+ rid.setValue(asUTC(rid.value()))
try:
del rid.params()["TZID"]
except KeyError:
Modified: CalendarServer/trunk/twistedcaldav/scheduling/icaldiff.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/icaldiff.py 2010-02-25 04:25:36 UTC (rev 5204)
+++ CalendarServer/trunk/twistedcaldav/scheduling/icaldiff.py 2010-02-25 04:26:03 UTC (rev 5205)
@@ -15,6 +15,7 @@
##
from twext.python.log import Logger
+from twext.python.datetime import asUTC, iCalendarString
from twistedcaldav.config import config
from twistedcaldav.dateops import normalizeToUTC, toString,\
@@ -281,7 +282,7 @@
# Get all EXDATEs in UTC
exdates = set()
for exdate in master.properties("EXDATE"):
- exdates.update([normalizeToUTC(value) for value in exdate.value()])
+ exdates.update([asUTC(value) for value in exdate.value()])
return exdates, map, master
@@ -576,7 +577,7 @@
newdue = component.getProperty("DUE")
if newdue is not None:
- newdue = normalizeToUTC(newdue.value())
+ newdue = asUTC(newdue.value())
# Recurrence rules - we need to normalize the order of the value parts
newrrules = set()
@@ -591,13 +592,13 @@
newrdates = set()
rdates = component.properties("RDATE")
for rdate in rdates:
- newrdates.update([normalizeToUTC(value) for value in rdate.value()])
+ newrdates.update([asUTC(value) for value in rdate.value()])
# EXDATEs
newexdates = set()
exdates = component.properties("EXDATE")
for exdate in exdates:
- newexdates.update([normalizeToUTC(value) for value in exdate.value()])
+ newexdates.update([asUTC(value) for value in exdate.value()])
return newdtstart, newdtend, newdue, newrrules, newrdates, newexdates
Modified: CalendarServer/trunk/twistedcaldav/scheduling/itip.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2010-02-25 04:25:36 UTC (rev 5204)
+++ CalendarServer/trunk/twistedcaldav/scheduling/itip.py 2010-02-25 04:26:03 UTC (rev 5205)
@@ -36,6 +36,7 @@
from vobject.icalendar import dateTimeToString
from twext.python.log import Logger
+from twext.python.datetime import asUTC, iCalendarString
from twistedcaldav.config import config
from twistedcaldav.dateops import normalizeToUTC, toString
@@ -542,7 +543,7 @@
comp.addProperty(Property("SEQUENCE", seq))
comp.addProperty(instance.getOrganizerProperty())
if instance_rid:
- comp.addProperty(Property("RECURRENCE-ID", normalizeToUTC(instance_rid)))
+ comp.addProperty(Property("RECURRENCE-ID", asUTC(instance_rid)))
def addProperties(propname):
for property in instance.properties(propname):
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20100224/dba556db/attachment-0001.html>
More information about the calendarserver-changes
mailing list