[CalendarServer-changes] [2833] CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/ ical.py
source_changes at macosforge.org
source_changes at macosforge.org
Tue Aug 19 12:07:57 PDT 2008
Revision: 2833
http://trac.macosforge.org/projects/calendarserver/changeset/2833
Author: cdaboo at apple.com
Date: 2008-08-19 12:07:56 -0700 (Tue, 19 Aug 2008)
Log Message:
-----------
Method to list all VTIMEZONE TZIDs present in a calendar.
Modified Paths:
--------------
CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/ical.py
Modified: CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/ical.py
===================================================================
--- CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/ical.py 2008-08-18 21:29:54 UTC (rev 2832)
+++ CalendarServer/branches/users/cdaboo/implicit-2805/twistedcaldav/ical.py 2008-08-19 19:07:56 UTC (rev 2833)
@@ -672,6 +672,22 @@
return result
+ def timezones(self):
+ """
+ Returns the set of TZID's for each VTIMEZONE component.
+
+ @return: a set of strings, one for each unique TZID value.
+ """
+
+ assert self.name() == "VCALENDAR", "Not a calendar: %r" % (self,)
+
+ results = set()
+ for component in self.subcomponents():
+ if component.name() == "VTIMEZONE":
+ results.add(component.propertyValue("TZID"))
+
+ return results
+
def expand(self, start, end):
"""
Expand the components into a set of new components, one for each
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080819/c247b170/attachment.html
More information about the calendarserver-changes
mailing list