[CalendarServer-changes] [4801] CalendarServer/branches/users/cdaboo/deployment-partition-4722/ twistedcaldav/ical.py
source_changes at macosforge.org
source_changes at macosforge.org
Mon Nov 23 21:13:29 PST 2009
Revision: 4801
http://trac.macosforge.org/projects/calendarserver/changeset/4801
Author: cdaboo at apple.com
Date: 2009-11-23 21:13:25 -0800 (Mon, 23 Nov 2009)
Log Message:
-----------
Better cu-address normalization.
Modified Paths:
--------------
CalendarServer/branches/users/cdaboo/deployment-partition-4722/twistedcaldav/ical.py
Modified: CalendarServer/branches/users/cdaboo/deployment-partition-4722/twistedcaldav/ical.py
===================================================================
--- CalendarServer/branches/users/cdaboo/deployment-partition-4722/twistedcaldav/ical.py 2009-11-23 20:46:35 UTC (rev 4800)
+++ CalendarServer/branches/users/cdaboo/deployment-partition-4722/twistedcaldav/ical.py 2009-11-24 05:13:25 UTC (rev 4801)
@@ -49,6 +49,7 @@
from twistedcaldav.dateops import compareDateTime, normalizeToUTC, timeRangesOverlap
from twistedcaldav.instance import InstanceList
from twistedcaldav.log import Logger
+from twistedcaldav.scheduling.cuaddress import normalizeCUAddr
log = Logger()
@@ -1155,18 +1156,10 @@
@return: the string value of the Organizer property, or None
"""
- # FIXME: we should really have a URL class and have it manage comparisons
- # in a sensible fashion.
- def _normalizeCUAddress(addr):
- if addr.startswith("/") or addr.startswith("http:") or addr.startswith("https:"):
- return addr.rstrip("/")
- else:
- return addr
-
# Need to normalize http/https cu addresses
test = set()
for item in match:
- test.add(_normalizeCUAddress(item))
+ test.add(normalizeCUAddr(item))
# Extract appropriate sub-component if this is a VCALENDAR
if self.name() == "VCALENDAR":
@@ -1176,7 +1169,7 @@
else:
# Find the primary subcomponent
for p in self.properties("ATTENDEE"):
- if _normalizeCUAddress(p.value()) in test:
+ if normalizeCUAddr(p.value()) in test:
return p
return None
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20091123/190b2b57/attachment.html>
More information about the calendarserver-changes
mailing list