From 942beef5de9772b3a76bb5c408aeebc82d1a49f8 Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Wed, 23 May 2012 23:07:23 +0900 Subject: [PATCH] allow != in properties --- anki/find.py | 2 +- tests/test_find.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/anki/find.py b/anki/find.py index a53a0286b..663aee0b8 100644 --- a/anki/find.py +++ b/anki/find.py @@ -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() diff --git a/tests/test_find.py b/tests/test_find.py index af8ebbace..c20346034 100644 --- a/tests/test_find.py +++ b/tests/test_find.py @@ -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