[CalendarServer-changes] [12366] twext/trunk/twext/who/expression.py

source_changes at macosforge.org source_changes at macosforge.org
Wed Mar 12 11:23:53 PDT 2014


Revision: 12366
          http://trac.calendarserver.org//changeset/12366
Author:   wsanchez at apple.com
Date:     2014-01-16 18:22:43 -0800 (Thu, 16 Jan 2014)
Log Message:
-----------
Define MatchType.none.

Modified Paths:
--------------
    twext/trunk/twext/who/expression.py

Modified: twext/trunk/twext/who/expression.py
===================================================================
--- twext/trunk/twext/who/expression.py	2014-01-16 23:39:26 UTC (rev 12365)
+++ twext/trunk/twext/who/expression.py	2014-01-17 02:22:43 UTC (rev 12366)
@@ -181,7 +181,11 @@
         return flags._normalize
 
 
+# Lame way to create a FlagsConstant with no flags in it:
+MatchFlags.none = MatchFlags.NOT & MatchFlags.caseInsensitive
 
+
+
 class MatchExpression(object):
     """
     Query for a matching value in a given field.
@@ -198,12 +202,8 @@
     def __init__(
         self,
         fieldName, fieldValue,
-        matchType=MatchType.equals, flags=None
+        matchType=MatchType.equals, flags=MatchFlags.none
     ):
-        if flags is None:
-            # Gross way to get a FlagsConstant with no flags in it:
-            flags = MatchFlags.NOT & MatchFlags.caseInsensitive
-
         self.fieldName = fieldName
         self.fieldValue = fieldValue
         self.matchType = matchType
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20140312/c67c1e81/attachment.html>


More information about the calendarserver-changes mailing list