[CalendarServer-changes] [9187] CalendarServer/trunk/contrib/performance

source_changes at macosforge.org source_changes at macosforge.org
Thu Apr 26 10:20:13 PDT 2012


Revision: 9187
          http://trac.macosforge.org/projects/calendarserver/changeset/9187
Author:   sagen at apple.com
Date:     2012-04-26 10:20:12 -0700 (Thu, 26 Apr 2012)
Log Message:
-----------
CalendarStore is being deprecated, replaced by EventKit

Modified Paths:
--------------
    CalendarServer/trunk/contrib/performance/display-calendar-events.py

Added Paths:
-----------
    CalendarServer/trunk/contrib/performance/eventkitframework.py

Modified: CalendarServer/trunk/contrib/performance/display-calendar-events.py
===================================================================
--- CalendarServer/trunk/contrib/performance/display-calendar-events.py	2012-04-26 16:16:17 UTC (rev 9186)
+++ CalendarServer/trunk/contrib/performance/display-calendar-events.py	2012-04-26 17:20:12 UTC (rev 9187)
@@ -14,15 +14,15 @@
 # limitations under the License.
 ##
 
+import eventkitframework as EventKit
 from Cocoa import NSDate
-from CalendarStore import CalCalendarStore
 
-store = CalCalendarStore.defaultCalendarStore()
-calendars = store.calendars()
+store = EventKit.EKEventStore.alloc().init()
+calendars = store.calendarsForEntityType_(0)
 print calendars
 raise SystemExit
 
-predicate = CalCalendarStore.eventPredicateWithStartDate_endDate_calendars_(
-    NSDate.date(), NSDate.distantFuture(),
-    [calendars[2]])
-print store.eventsWithPredicate_(predicate)
+predicate = store.predicateForEventsWithStartDate_endDate_calendars_(
+     NSDate.date(), NSDate.distantFuture(),
+     [calendars[2]])
+print store.eventsMatchingPredicate_(predicate)

Added: CalendarServer/trunk/contrib/performance/eventkitframework.py
===================================================================
--- CalendarServer/trunk/contrib/performance/eventkitframework.py	                        (rev 0)
+++ CalendarServer/trunk/contrib/performance/eventkitframework.py	2012-04-26 17:20:12 UTC (rev 9187)
@@ -0,0 +1,8 @@
+import objc as _objc
+
+__bundle__ = _objc.initFrameworkWrapper("EventKit",
+    frameworkIdentifier="com.apple.EventKit",
+    frameworkPath=_objc.pathForFramework(
+    "/System/Library/Frameworks/EventKit.framework"),
+    globals=globals())
+
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20120426/6c36b744/attachment.html>


More information about the calendarserver-changes mailing list