[CalendarServer-changes] [443]
CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/
directory
source_changes at macosforge.org
source_changes at macosforge.org
Mon Nov 13 16:14:46 PST 2006
Revision: 443
http://trac.macosforge.org/projects/calendarserver/changeset/443
Author: wsanchez at apple.com
Date: 2006-11-13 16:14:46 -0800 (Mon, 13 Nov 2006)
Log Message:
-----------
Add recordWithGUID() to IDirectoryService.
Modified Paths:
--------------
CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/appleopendirectory.py
CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/idirectory.py
CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py
Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/appleopendirectory.py 2006-11-14 00:10:30 UTC (rev 442)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/appleopendirectory.py 2006-11-14 00:14:46 UTC (rev 443)
@@ -120,6 +120,12 @@
def recordWithShortName(self, recordType, shortName):
return self._cacheRecords(recordType).get(shortName, None)
+ def recordWithGUID(self, guid):
+ for cache in self._cacheRecords.values():
+ if guid in cache:
+ return cache[guid]
+ return None
+
# def recordWithShortName(self, recordType, shortName):
# if recordType == "user":
# listRecords = opendirectory.listUsersWithAttributes
Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/idirectory.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/idirectory.py 2006-11-14 00:10:30 UTC (rev 442)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/idirectory.py 2006-11-14 00:14:46 UTC (rev 443)
@@ -48,9 +48,16 @@
@param recordType: the type of the record to look up.
@param shortName: the short name of the record to look up.
@return: an L{IDirectoryRecord} provider with the given short name, or
- C{None} of no such record exists.
+ C{None} if no such record exists.
"""
+ def recordWithGUID(guid):
+ """
+ @param shortName: the GUID of the record to look up.
+ @return: an L{IDirectoryRecord} provider with the given GUID, or C{None}
+ if no such record exists.
+ """
+
class IDirectoryRecord(Interface):
"""
Directory Record
@@ -61,13 +68,13 @@
shortName = Attribute("The name of this record.")
fullName = Attribute("The full name of this record.")
- def members(self):
+ def members():
"""
@return: an iterable of L{IDirectoryRecord}s for the members of this
(group) record.
"""
- def group(self):
+ def group():
"""
@return: an iterable of L{IDirectoryRecord}s for the groups this
record is a member of.
Modified: CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py
===================================================================
--- CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py 2006-11-14 00:10:30 UTC (rev 442)
+++ CalendarServer/branches/users/wsanchez/provisioning/twistedcaldav/directory/resource.py 2006-11-14 00:14:46 UTC (rev 443)
@@ -261,9 +261,10 @@
def calendarUserAddresses(self):
return (
+ # Principal URL
self.principalURL(),
- # Need to implement GUID->record lookup first
+ # Need to implement GUID->record->principal resource lookup first
#"urn:uuid:%s" % (self.record.guid,)
# Need to add email attribute to records if we want this
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20061113/c0fd2344/attachment.html
More information about the calendarserver-changes
mailing list