[CalendarServer-changes] [7076] CalendarServer/trunk/calendarserver/tools/notifications.py
source_changes at macosforge.org
source_changes at macosforge.org
Wed Feb 23 22:13:52 PST 2011
Revision: 7076
http://trac.macosforge.org/projects/calendarserver/changeset/7076
Author: sagen at apple.com
Date: 2011-02-23 22:13:50 -0800 (Wed, 23 Feb 2011)
Log Message:
-----------
calendarserver_monitor_notifications now monitors addressbook push notifications.
Modified Paths:
--------------
CalendarServer/trunk/calendarserver/tools/notifications.py
Modified: CalendarServer/trunk/calendarserver/tools/notifications.py
===================================================================
--- CalendarServer/trunk/calendarserver/tools/notifications.py 2011-02-24 04:35:04 UTC (rev 7075)
+++ CalendarServer/trunk/calendarserver/tools/notifications.py 2011-02-24 06:13:50 UTC (rev 7076)
@@ -344,7 +344,7 @@
def getPrincipalDetails(self, path):
"""
Given a principal path, retrieve and return the corresponding
- displayname and set of calendar homes.
+ displayname and set of calendar/addressbook homes.
"""
name = ""
@@ -355,9 +355,11 @@
}
body = """<?xml version="1.0" encoding="UTF-8"?>
<A:propfind xmlns:A="DAV:"
- xmlns:C="urn:ietf:params:xml:ns:caldav">
+ xmlns:CARD="urn:ietf:params:xml:ns:carddav"
+ xmlns:CAL="urn:ietf:params:xml:ns:caldav">
<A:prop>
- <C:calendar-home-set/>
+ <CAL:calendar-home-set/>
+ <CARD:addressbook-home-set/>
<A:displayname/>
</A:prop>
</A:propfind>
@@ -380,6 +382,12 @@
href = href.text
if href:
homes.append(href)
+ addressbookHomeSet = prop.find("{urn:ietf:params:xml:ns:carddav}addressbook-home-set")
+ if addressbookHomeSet is not None:
+ for href in addressbookHomeSet.findall("{DAV:}href"):
+ href = href.text
+ if href:
+ homes.append(href)
displayName = prop.find("{DAV:}displayname")
if displayName is not None:
displayName = displayName.text
@@ -487,7 +495,10 @@
href = response.find("{DAV:}href")
key = None
name = None
- kind = "home"
+ if path.startswith("/calendars"):
+ kind = "Calendar home"
+ else:
+ kind = "AddressBook home"
for propstat in response.findall("{DAV:}propstat"):
status = propstat.find("{DAV:}status")
if "200 OK" in status.text:
@@ -501,7 +512,7 @@
if resourceType is not None:
shared = resourceType.find("{http://calendarserver.org/ns/}shared")
if shared is not None:
- kind = "shared collection"
+ kind = "Shared calendar"
pushKey = prop.find("{http://calendarserver.org/ns/}pushkey")
if pushKey is not None:
pushKey = pushKey.text
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110223/b277bdac/attachment-0001.html>
More information about the calendarserver-changes
mailing list