[CalendarServer-changes] [3001] CalendarServer/branches/users/sagen/principal-property-search-2995/ twistedcaldav/directory

source_changes at macosforge.org source_changes at macosforge.org
Tue Sep 16 11:40:44 PDT 2008


Revision: 3001
          http://trac.macosforge.org/projects/calendarserver/changeset/3001
Author:   sagen at apple.com
Date:     2008-09-16 11:40:44 -0700 (Tue, 16 Sep 2008)
Log Message:
-----------
Remove recordsStartingWith( ) since recordsMatchingFields( ) is more general.

Modified Paths:
--------------
    CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/aggregate.py
    CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/appleopendirectory.py
    CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/idirectory.py
    CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/sudo.py

Modified: CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/aggregate.py
===================================================================
--- CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/aggregate.py	2008-09-16 18:37:34 UTC (rev 3000)
+++ CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/aggregate.py	2008-09-16 18:40:44 UTC (rev 3001)
@@ -103,9 +103,6 @@
     def recordWithCalendarUserAddress(self, address):
         return self._queryAll("recordWithCalendarUserAddress", address)
 
-    def recordsStartingWith(self, str):
-        return self._queryAll("recordsStartingWith", str)
-
     def recordsMatchingFields(self, fields, caseInsensitive=True, operand="or"):
         return self._queryAll("recordsMatchingFields", fields,
             caseInsensitive=caseInsensitive, operand=operand)

Modified: CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/appleopendirectory.py
===================================================================
--- CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/appleopendirectory.py	2008-09-16 18:37:34 UTC (rev 3000)
+++ CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/appleopendirectory.py	2008-09-16 18:40:44 UTC (rev 3001)
@@ -460,61 +460,7 @@
 
         return record
 
-    def recordsStartingWith(self, string):
-        results = opendirectory.queryRecordsWithAttributes(
-            self.directory,
-            dsquery.expression(dsquery.expression.OR,
-                (
-                    dsquery.match(dsattributes.kDS1AttrFirstName, string,
-                        dsattributes.eDSStartsWith),
-                    dsquery.match(dsattributes.kDS1AttrLastName, string,
-                        dsattributes.eDSStartsWith),
-                    dsquery.match(dsattributes.kDSNAttrEMailAddress, string,
-                        dsattributes.eDSStartsWith)
-                )
-            ).generate(),
-            True,
-            dsattributes.kDSStdRecordTypeUsers,
-            [
-                dsattributes.kDS1AttrGeneratedUID,
-                dsattributes.kDS1AttrFirstName,
-                dsattributes.kDS1AttrLastName,
-                dsattributes.kDSNAttrEMailAddress,
-                dsattributes.kDS1AttrDistinguishedName,
-                dsattributes.kDSNAttrMetaNodeLocation,
-            ]
-        )
-        returning = []
-        for key, val in results.iteritems():
-            try:
-                calendarUserAddresses = set()
-                enabledForCalendaring = False
-                if val.has_key(dsattributes.kDSNAttrEMailAddress):
-                    enabledForCalendaring = True
-                    calendarUserAddresses.add(val[dsattributes.kDSNAttrEMailAddress])
-                rec = OpenDirectoryRecord(
-                    service               = self,
-                    recordType            = DirectoryService.recordType_users,
-                    guid                  = val[dsattributes.kDS1AttrGeneratedUID],
-                    nodeName              = val[dsattributes.kDSNAttrMetaNodeLocation],
-                    shortName             = key,
-                    fullName              = val[dsattributes.kDS1AttrDistinguishedName],
-                    firstName             = val[dsattributes.kDS1AttrFirstName],
-                    lastName              = val[dsattributes.kDS1AttrLastName],
-                    calendarUserAddresses = calendarUserAddresses,
-                    autoSchedule          = False,
-                    enabledForCalendaring = enabledForCalendaring,
-                    memberGUIDs           = (),
-                    proxyGUIDs            = (),
-                    readOnlyProxyGUIDs    = (),
-                )
-                returning.append(rec)
-            except Exception, e:
-                print e
-                import pdb; pdb.set_trace()
 
-        return returning
-
     _ODFields = {
         'firstName' : dsattributes.kDS1AttrFirstName,
         'lastName' : dsattributes.kDS1AttrLastName,

Modified: CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/idirectory.py
===================================================================
--- CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/idirectory.py	2008-09-16 18:37:34 UTC (rev 3000)
+++ CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/idirectory.py	2008-09-16 18:40:44 UTC (rev 3001)
@@ -72,13 +72,6 @@
             addresses.
         """
 
-    def recordsStartingWith(string):
-        """
-        @return: a sequence of L{IDirectoryRecord}s whose first name, last
-            name, or email address start with the given string (case
-            insensitive)
-        """
-
     def recordsMatchingFields(fields):
         """
         @return: a sequence of L{IDirectoryRecord}s which match the given

Modified: CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/sudo.py
===================================================================
--- CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/sudo.py	2008-09-16 18:37:34 UTC (rev 3000)
+++ CalendarServer/branches/users/sagen/principal-property-search-2995/twistedcaldav/directory/sudo.py	2008-09-16 18:40:44 UTC (rev 3001)
@@ -98,9 +98,6 @@
             if entry['username'] == shortName:
                 return self._recordForEntry(entry)
 
-    def recordsStartingWith(self, string):
-        return None
-
     def requestAvatarId(self, credentials):
         # FIXME: ?
         # We were checking if principal is enabled; seems unnecessary in current
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20080916/fdb739c3/attachment.html 


More information about the calendarserver-changes mailing list