Coverage for dataflake/fakeldap/queryparser.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (c) 2012 Jens Vagelpohl and Contributors. All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ##############################################################################
# From http://www.ietf.org/rfc/rfc2254.txt, Section 4 # # filter = "(" filtercomp ")" # filtercomp = and / or / not / item # and = "&" filterlist # or = "|" filterlist # not = "!" filter # filterlist = 1*filter # item = simple / present / substring / extensible # simple = attr filtertype value # filtertype = equal / approx / greater / less # equal = "=" # approx = "~=" # greater = ">=" # less = "<=" # extensible = attr [":dn"] [":" matchingrule] ":=" value # / [":dn"] ":" matchingrule ":=" value # present = attr "=*" # substring = attr "=" [initial] any [final] # initial = value # any = "*" *(value "*") # final = value # attr = AttributeDescription from Section 4.1.5 of [1] # matchingrule = MatchingRuleId from Section 4.1.9 of [1] # value = AttributeValue from Section 4.1.6 of [1]
br'(?P<value>[\*\w\s=,\\\'@\-\+_\.' + br'\xc3\xb8\xc3\x98\xc3\xa6\xc3\x86\xc3\xa5\xc3\x85\xc3' + br'\xa4\xc3\x84\xc3\xb6\xc3\x96\xc3\xbc\xc3\x9c\xc3\x9f]*?)\)')
""" Parse a query string into a series of Ops and Filters """ # Match outermost operations else:
# Match internal filter.
""" Flatten a sequence of Ops/Filters leaving only ``klass`` instances """
""" Separate a parsed query into operations """
else:
# A simple filter with no operands # Very likely a single operand around a group of filters.
""" Compare parsed queries and return common query elements """
|