New support for filtering elements by checking values against an enumeration

This commit is contained in:
Dion Moult
2022-03-22 10:49:48 +11:00
parent efb89acfa3
commit eaa3301b8f
2 changed files with 20 additions and 1 deletions
@@ -46,7 +46,8 @@ class Selector:
and: "&"
or: "|"
not: "!"
comparison: (not)* (contains | morethanequalto | lessthanequalto | equal | morethan | lessthan)
comparison: (not)* (oneof | contains | morethanequalto | lessthanequalto | equal | morethan | lessthan)
oneof: "%="
contains: "*="
morethanequalto: ">="
lessthanequalto: "<="
@@ -245,6 +246,8 @@ class Selector:
return element_value >= value
elif comparison == "lessthanequalto":
return element_value <= value
elif comparison == "oneof":
return element_value in value.split(",")
return False
@classmethod