[CalendarServer-changes] [10664] CalendarServer/trunk/twext/who/xml.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Feb 7 17:55:17 PST 2013


Revision: 10664
          http://trac.calendarserver.org//changeset/10664
Author:   wsanchez at apple.com
Date:     2013-02-07 17:55:16 -0800 (Thu, 07 Feb 2013)
Log Message:
-----------
_DescriptionMixIn is gone.
indexedRecordsFromMatchExpression() now returns a frozenset to avoid having the index mutated on accident.

Modified Paths:
--------------
    CalendarServer/trunk/twext/who/xml.py

Modified: CalendarServer/trunk/twext/who/xml.py
===================================================================
--- CalendarServer/trunk/twext/who/xml.py	2013-02-08 01:54:12 UTC (rev 10663)
+++ CalendarServer/trunk/twext/who/xml.py	2013-02-08 01:55:16 UTC (rev 10664)
@@ -40,7 +40,6 @@
 from twext.who.directory import DirectoryService as BaseDirectoryService
 from twext.who.directory import DirectoryRecord as BaseDirectoryRecord
 from twext.who.directory import MergedConstants
-from twext.who.idirectory import _DescriptionMixIn # FIXME
 
 
 
@@ -48,7 +47,7 @@
 # Data type extentions
 ##
 
-class FieldName(Names, _DescriptionMixIn):
+class FieldName(Names):
     memberUIDs = NamedConstant()
     memberUIDs.description = "member UIDs"
     memberUIDs.multiValue = True
@@ -321,15 +320,19 @@
         @param expression: an expression
         @type expression: L{object}
         """
+        fieldIndex = self.index[expression.fieldName]
+
         if expression.matchType != MatchType.equals:
             raise NotImplementedError("Handle MatchType != equals")
 
         if expression.flags:
             raise NotImplementedError("Handle QueryFlags")
 
-        return succeed(self.index[expression.fieldName].get(expression.fieldValue, ()))
+        matchingRecords = fieldIndex.get(expression.fieldValue, ())
 
+        return succeed(frozenset(matchingRecords))
 
+
     def unIndexedRecordsFromMatchExpression(self, expression):
         """
         Finds records not in the internal indexes matching a single
@@ -339,6 +342,7 @@
         """
         raise NotImplementedError("Handle unindexed fields")
 
+
     def recordsFromExpression(self, expression):
         if isinstance(expression, DirectoryQueryMatchExpression):
             if expression.fieldName in self.indexedFields:
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20130207/e519cb30/attachment.html>


More information about the calendarserver-changes mailing list