Home | History | Annotate | Download | only in setools

Lines Matching refs:criteria

21 def match_regex(obj, criteria, regex):
27 criteria The criteria to match.
32 return bool(criteria.search(str(obj)))
34 return obj == criteria
37 def match_set(obj, criteria, equal):
43 criteria The criteria to match. (a set)
49 return obj == criteria
51 return bool(obj.intersection(criteria))
54 def match_in_set(obj, criteria, regex):
56 Match if the criteria is in the list, with optional
61 criteria The criteria to match.
66 return [m for m in obj if criteria.search(str(m))]
68 return criteria in obj
71 def match_indirect_regex(obj, criteria, indirect, regex):
77 criteria The criteria to match.
85 return [o for o in obj.expand() if criteria.search(str(o))]
87 return set(criteria.expand()).intersection(obj.expand())
89 return match_regex(obj, criteria, regex)
92 def match_regex_or_set(obj, criteria, equal, regex):
101 criteria The criteria to match.
109 return [m for m in obj if criteria.search(str(m))]
111 return match_set(obj, set(criteria), equal)
114 def match_range(obj, criteria, subset, overlap, superset, proper):
119 criteria An object with attributes named "low" and "high", representing the criteria.
120 subset If true, the criteria will match if it is a subset obj's range.
121 overlap If true, the criteria will match if it overlaps any of the obj's range.
122 superset If true, the criteria will match if it is a superset of the obj's range.
128 return ((obj.low <= criteria.low <= obj.high) or (
129 obj.low <= criteria.high <= obj.high) or (
130 criteria.low <= obj.low and obj.high <= criteria.high))
133 return ((obj.low < criteria.low and criteria.high <= obj.high) or (
134 obj.low <= criteria.low and criteria.high < obj.high))
136 return obj.low <= criteria.low and criteria.high <= obj.high
139 return ((criteria.low < obj.low and obj.high <= criteria.high) or (
140 criteria.low <= obj.low and obj.high < criteria.high))
142 return (criteria.low <= obj.low and obj.high <= criteria.high)
144 return criteria.low == obj.low and obj.high == criteria.high
147 def match_level(obj, criteria, dom, domby, incomp):
152 criteria The criteria to match. (a level)
153 dom If true, the criteria will match if it dominates obj.
154 domby If true, the criteria will match if it is dominated by obj.
155 incomp If true, the criteria will match if it is incomparable to obj.
159 return (criteria >= obj)
161 return (criteria <= obj)
163 return (criteria ^ obj)
165 return (criteria == obj)