A query filter is always a list. The first item in the list is the
operator (e.g. [OP_AND, ...]
), while the other items depend
on the operator. For logic operators (e.g. OP_AND, OP_OR), they are
subfilters whose results are combined. Unary operators take exactly one
other item (e.g. a subfilter for OP_NOT and a
field name for OP_TRUE). Binary operators take exactly two operands,
usually a field name and a value to compare against. Filters are
converted to callable functions by query._CompileFilter.
|
|
|
|
|
_ConvertRegexpValue(_,
loc,
toks)
Regular expression value for condition. |
source code
|
|
pyparsing.ParserElement
|
BuildFilterParser()
Builds a parser for query filter strings. |
source code
|
|
list
|
|
bool
|
_CheckFilter(text)
CHecks if a string could be a filter. |
source code
|
|
bool
|
_CheckGlobbing(text)
Checks if a string could be a globbing pattern. |
source code
|
|
|
_MakeFilterPart(namefield,
text,
isnumeric=False)
Generates filter for one argument. |
source code
|
|
list
|
MakeFilter(args,
force_filter,
namefield=None,
isnumeric=False)
Try to make a filter from arguments to a command. |
source code
|
|
|
OP_OR = constants.QLANG_OP_OR
|
|
OP_AND = constants.QLANG_OP_AND
|
|
OP_NOT = constants.QLANG_OP_NOT
|
|
OP_TRUE = constants.QLANG_OP_TRUE
|
|
OP_EQUAL = constants.QLANG_OP_EQUAL
|
|
OP_NOT_EQUAL = constants.QLANG_OP_NOT_EQUAL
|
|
OP_LT = constants.QLANG_OP_LT
|
|
OP_LE = constants.QLANG_OP_LE
|
|
OP_GT = constants.QLANG_OP_GT
|
|
OP_GE = constants.QLANG_OP_GE
|
|
OP_REGEXP = constants.QLANG_OP_REGEXP
|
|
OP_CONTAINS = constants.QLANG_OP_CONTAINS
|
|
FILTER_DETECTION_CHARS = constants.QLANG_FILTER_DETECTION_CHARS
|
|
GLOB_DETECTION_CHARS = constants.QLANG_GLOB_DETECTION_CHARS
|
|
_KNOWN_REGEXP_DELIM = "/#^|"
|
|
_KNOWN_REGEXP_FLAGS = frozenset("si")
|