allow != in properties

This commit is contained in:
Damien Elmes 2012-05-23 23:07:23 +09:00
parent b63ac7e80d
commit 942beef5de
2 changed files with 2 additions and 1 deletions

View file

@ -256,7 +256,7 @@ class Finder(object):
def _findProp(self, val):
# extract
m = re.match("(^.+?)(<=|>=|=|<|>)(.+?$)", val)
m = re.match("(^.+?)(<=|>=|!=|=|<|>)(.+?$)", val)
if not m:
return
prop, cmp, val = m.groups()

View file

@ -161,6 +161,7 @@ def test_findCards():
assert len(deck.findCards("prop:ivl>=5")) == 1
assert len(deck.findCards("prop:ivl=9")) == 0
assert len(deck.findCards("prop:ivl=10")) == 1
assert len(deck.findCards("prop:ivl!=10")) > 1
assert len(deck.findCards("prop:due>0")) == 1
# due dates should work
deck.sched.today = 15