[CalendarServer-changes] [11748] PyCalendar/branches/json-2/src/pycalendar/icalendar
source_changes at macosforge.org
source_changes at macosforge.org
Mon Sep 23 03:20:23 PDT 2013
Revision: 11748
http://trac.calendarserver.org//changeset/11748
Author: cdaboo at apple.com
Date: 2013-09-23 03:20:22 -0700 (Mon, 23 Sep 2013)
Log Message:
-----------
VPOLL tweaks.
Modified Paths:
--------------
PyCalendar/branches/json-2/src/pycalendar/icalendar/definitions.py
PyCalendar/branches/json-2/src/pycalendar/icalendar/property.py
PyCalendar/branches/json-2/src/pycalendar/icalendar/vpoll.py
Modified: PyCalendar/branches/json-2/src/pycalendar/icalendar/definitions.py
===================================================================
--- PyCalendar/branches/json-2/src/pycalendar/icalendar/definitions.py 2013-09-23 10:02:44 UTC (rev 11747)
+++ PyCalendar/branches/json-2/src/pycalendar/icalendar/definitions.py 2013-09-23 10:20:22 UTC (rev 11748)
@@ -344,6 +344,7 @@
# Section 4.2
cICalProperty_ACCEPT_RESPONSE = "ACCEPT-RESPONSE"
cICalProperty_POLL_ITEM_ID = "POLL-ITEM-ID"
+cICalProperty_POLL_WINNER = "POLL-WINNER"
cICalProperty_POLL_MODE = "POLL-MODE"
cICalProperty_POLL_MODE_BASIC = "BASIC"
cICalProperty_POLL_PROPERTIES = "POLL-PROPERTIES"
Modified: PyCalendar/branches/json-2/src/pycalendar/icalendar/property.py
===================================================================
--- PyCalendar/branches/json-2/src/pycalendar/icalendar/property.py 2013-09-23 10:02:44 UTC (rev 11747)
+++ PyCalendar/branches/json-2/src/pycalendar/icalendar/property.py 2013-09-23 10:20:22 UTC (rev 11748)
@@ -102,6 +102,15 @@
# Extensions: draft-daboo-valarm-extensions-03
definitions.cICalProperty_ACKNOWLEDGED : Value.VALUETYPE_DATETIME,
+ # Extensions: draft-york-vpoll-00.txt
+ # Section 4.2
+ definitions.cICalProperty_ACCEPT_RESPONSE : Value.VALUETYPE_TEXT,
+ definitions.cICalProperty_POLL_ITEM_ID : Value.VALUETYPE_TEXT,
+ definitions.cICalProperty_POLL_WINNER : Value.VALUETYPE_TEXT,
+ definitions.cICalProperty_POLL_MODE : Value.VALUETYPE_TEXT,
+ definitions.cICalProperty_POLL_PROPERTIES : Value.VALUETYPE_TEXT,
+ definitions.cICalProperty_VOTER : Value.VALUETYPE_CALADDRESS,
+
# Apple Extensions
definitions.cICalProperty_XWRCALNAME : Value.VALUETYPE_TEXT,
definitions.cICalProperty_XWRCALDESC : Value.VALUETYPE_TEXT,
Modified: PyCalendar/branches/json-2/src/pycalendar/icalendar/vpoll.py
===================================================================
--- PyCalendar/branches/json-2/src/pycalendar/icalendar/vpoll.py 2013-09-23 10:02:44 UTC (rev 11747)
+++ PyCalendar/branches/json-2/src/pycalendar/icalendar/vpoll.py 2013-09-23 10:20:22 UTC (rev 11748)
@@ -64,4 +64,16 @@
definitions.cICalProperty_DTEND,
)
+
+ def sortedComponents(self):
+ """
+ Also take POLL-ID into account
+ """
+
+ components = self.mComponents[:]
+
+ # Write out the remainder sorted by name, sortKey
+ return sorted(components, key=lambda x: (x.getType().upper(), x.loadValueString(definitions.cICalProperty_POLL_ITEM_ID),))
+
+
Component.registerComponent(definitions.cICalComponent_VPOLL, VPoll)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130923/f746b26c/attachment.html>
More information about the calendarserver-changes
mailing list