original_docstring: 
      Create an expression for a single prop-filter element.
  
      @param propfilter: the L{PropertyFilter} element.
      @return: a L{baseExpression} for the expression tree.
      
docstring: Create an expression for a single prop-filter element.
docstring_tokens: Create an expression for a single prop - filter element .
code: def propfilterExpression(propfilter, fields):
      """
      Create an expression for a single prop-filter element.
  
      @param propfilter: the L{PropertyFilter} element.
      @return: a L{baseExpression} for the expression tree.
      """
  
      # Only handle UID right now
      if propfilter.filter_name != "UID":
          raise ValueError
  
      # Handle is-not-defined case
      if not propfilter.defined:
          # Test for <<field>> != "*"
          return expression.isExpression(fields["UID"], "", True)
  
      # Determine logical expression grouping
      logical = expression.andExpression if propfilter.filter_test == "allof" else expression.orExpression
  
      # Handle time-range - we cannot do this with our Index right now
      if propfilter.qualifier and isinstance(propfilter.qualifier, TimeRange):
          raise ValueError
  
      # Handle text-match
      tm = None
      if propfilter.qualifier and isinstance(propfilter.qualifier, TextMatch):
          if propfilter.qualifier.match_type == "equals":
              tm = expression.isnotExpression if propfilter.qualifier.negate else expression.isExpression
          elif propfilter.qualifier.match_type == "contains":
              tm = expression.notcontainsExpression if propfilter.qualifier.negate else expression.containsExpression
          elif propfilter.qualifier.match_type == "starts-with":
              tm = expression.notstartswithExpression if propfilter.qualifier.negate else expression.startswithExpression
          elif propfilter.qualifier.match_type == "ends-with":
              tm = expression.notendswithExpression if propfilter.qualifier.negate else expression.endswithExpression
          tm = tm(fields[propfilter.filter_name], propfilter.qualifier.text, propfilter.qualifier.caseless)
  
      # Handle embedded parameters - we do not right now as our Index does not handle them
      params = []
      for _ignore in propfilter.filters:
          raise ValueError
      if len(params) > 1:
          paramsExpression = logical(params)
      elif len(params) == 1:
          paramsExpression = params[0]
      else:
          paramsExpression = None
  
      # Now build return expression
      if (tm is not None) and (paramsExpression is not None):
          return logical([tm, paramsExpression])
      elif tm is not None:
          return tm
      elif paramsExpression is not None:
          return paramsExpression
      else:
          return None
code_tokens: def propfilterExpression ( propfilter , fields ) : if propfilter . filter_name != "UID" : raise ValueError if not propfilter . defined : return expression . isExpression ( fields [ "UID" ] , "" , True ) logical = expression . andExpression if propfilter . filter_test == "allof" else expression . orExpression if propfilter . qualifier and isinstance ( propfilter . qualifier , TimeRange ) : raise ValueError tm = None if propfilter . qualifier and isinstance ( propfilter . qualifier , TextMatch ) : if propfilter . qualifier . match_type == "equals" : tm = expression . isnotExpression if propfilter . qualifier . negate else expression . isExpression elif propfilter . qualifier . match_type == "contains" : tm = expression . notcontainsExpression if propfilter . qualifier . negate else expression . containsExpression elif propfilter . qualifier . match_type == "starts-with" : tm = expression . notstartswithExpression if propfilter . qualifier . negate else expression . startswithExpression elif propfilter . qualifier . match_type == "ends-with" : tm = expression . notendswithExpression if propfilter . qualifier . negate else expression . endswithExpression tm = tm ( fields [ propfilter . filter_name ] , propfilter . qualifier . text , propfilter . qualifier . caseless ) params = [ ] for _ignore in propfilter . filters : raise ValueError if len ( params ) > 1 : paramsExpression = logical ( params ) elif len ( params ) == 1 : paramsExpression = params [ 0 ] else : paramsExpression = None if ( tm is not None ) and ( paramsExpression is not None ) : return logical ( [ tm , paramsExpression ] ) elif tm is not None : return tm elif paramsExpression is not None : return paramsExpression else : return None
short_docstring: Create an expression for a single prop-filter element.
short_docstring_tokens: Create an expression for a single prop - filter element .
comment: """
      Create an expression for a single prop-filter element.
  
      @param propfilter: the L{PropertyFilter} element.
      @return: a L{baseExpression} for the expression tree.
      """$SEP$# Only handle UID right now$SEP$# Handle is-not-defined case$SEP$# Test for <<field>> != "*"$SEP$# Determine logical expression grouping$SEP$# Handle time-range - we cannot do this with our Index right now$SEP$# Handle text-match$SEP$# Handle embedded parameters - we do not right now as our Index does not handle them$SEP$# Now build return expression