poco.sdk.DefaultMatcher module
- class DefaultMatcher[source]
Bases:
IMatcherDefault matcher implementation for poco hierarchy traversing. Including logical query condition and predicate expression. When traversing through the hierarchy tree, matcher will apply the match method on each node of the tree.
The formal definition of query condition as follows:
expr := (op0, (expr0, expr1, ...)) expr := (op1, (arg1, arg2))
op0stris logical operator (‘or’ or ‘and’) which has the same semantics as in python, e.g. ‘or’ means this expression/condition matches if any of the exprN matchesop1stris comparator, can be one of as follows:op1 := 'attr=' op1 := 'attr.*=' op1 := ... (other customized)
attr=corresponds toEqualizationComparator.attr.*=corresponds toRegexpComparator.
The
op1must be a string. TheMatcherwill help to map toComparatorobject.
- class EqualizationComparator[source]
Bases:
objectCompare two objects using the native equivalence (==) comparison operator