onyo.lib.filters module
- class onyo.lib.filters.Filter(_arg)[source]
Bases:
objectTranslate a string regular expression to a match function.
Intended for use with string patterns passed from Onyo’s CLI.
This can be used along with builtin
filter()to remove non-matching items. For example:repo = Repo() f = Filter('foo=bar') assets[:] = filter(f.match, repo.assets)
- __init__(_arg)
- match(item)[source]
Does
itemmatch thisFilter.- Parameters:
item (
Item) – Item to match against.- Raises:
OnyoInvalidFilterError – No valid operator was found.
- Return type: