[CalendarServer-changes] [1025] CalendarServer/trunk/twistedcaldav/directory

source_changes at macosforge.org source_changes at macosforge.org
Thu Jan 11 14:56:58 PST 2007


Revision: 1025
          http://trac.macosforge.org/projects/calendarserver/changeset/1025
Author:   wsanchez at apple.com
Date:     2007-01-11 14:56:58 -0800 (Thu, 11 Jan 2007)

Log Message:
-----------
minor

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
    CalendarServer/trunk/twistedcaldav/directory/principal.py

Modified: CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2007-01-11 20:51:00 UTC (rev 1024)
+++ CalendarServer/trunk/twistedcaldav/directory/appleopendirectory.py	2007-01-11 22:56:58 UTC (rev 1025)
@@ -82,7 +82,8 @@
             DirectoryService.recordType_users,
             DirectoryService.recordType_groups,
             DirectoryService.recordType_locations,
-            DirectoryService.recordType_resources)
+            DirectoryService.recordType_resources,
+        )
 
     def _cacheRecords(self, recordType):
         if recordType not in self._records:
@@ -93,11 +94,12 @@
                 dsattributes.kDS1AttrDistinguishedName,
                 dsattributes.kDSNAttrCalendarPrincipalURI,
             ]
+
             if recordType == DirectoryService.recordType_users:
                 listRecordType = dsattributes.kDSStdRecordTypeUsers
             elif recordType == DirectoryService.recordType_groups:
                 listRecordType = dsattributes.kDSStdRecordTypeGroups
-                attrs += [dsattributes.kDSNAttrGroupMembers,]
+                attrs.append(dsattributes.kDSNAttrGroupMembers)
             elif recordType == DirectoryService.recordType_locations:
                 listRecordType = dsattributes.kDSStdRecordTypeLocations
             elif recordType == DirectoryService.recordType_resources:
@@ -120,11 +122,13 @@
                     continue
                 realName = value.get(dsattributes.kDS1AttrDistinguishedName)
 
+                # FIXME: We get email address also
+                # FIXME: In new schema, kDSNAttrCalendarPrincipalURI goes away
                 cuaddrs = value.get(dsattributes.kDSNAttrCalendarPrincipalURI)
                 cuaddrset = set()
                 if cuaddrs is not None:
                     if isinstance(cuaddrs, str):
-                        cuaddrset.update((cuaddrs,))
+                        cuaddrset.add(cuaddrs)
                     else:
                         cuaddrset.update(cuaddrs)
 

Modified: CalendarServer/trunk/twistedcaldav/directory/principal.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/directory/principal.py	2007-01-11 20:51:00 UTC (rev 1024)
+++ CalendarServer/trunk/twistedcaldav/directory/principal.py	2007-01-11 22:56:58 UTC (rev 1025)
@@ -449,7 +449,9 @@
     def calendarUserAddresses(self):
         # Add the principal URL to whatever calendar user addresses
         # the directory record provides.
-        return (self.principalURL(),) + tuple(self.record.calendarUserAddresses)
+        addresses = set(self.record.calendarUserAddresses)
+        addresses.add(self.principalURL())
+        return addresses
 
     def scheduleInbox(self, request):
         home = self._calendarHome()

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20070111/0e9b0e48/attachment.html


More information about the calendarserver-changes mailing list