From b522b7aa6954e69d15ae6b58b24ee1045d1e07b0 Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Mon, 17 Mar 2014 11:39:07 +0100 Subject: [PATCH] =?UTF-8?q?[filter2]=20Possibilit=C3=A9=20d'utiliser=20des?= =?UTF-8?q?=20<=20ou=20>=20dans=20les=20filtres=20humains?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- filter2.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/filter2.py b/filter2.py index e696373..1406775 100644 --- a/filter2.py +++ b/filter2.py @@ -21,7 +21,7 @@ def prioritize(l): if not isinstance(l, list): return l l=simplify(l) - for c in ['!=', '=', '&', '|']: + for c in ['!=', '<', '>', '=', '&', '|']: i=0 while i=%s)" % (l[1], l[2]) + elif op == ">": + return "!(%s<=%s)" % (l[1], l[2]) elif op == "!=": return "!(%s=%s)" % (l[1], l[2]) return op + ''.join(['(%s)' % toldapfilter(i) for i in l[1:]]) @@ -63,8 +67,8 @@ def pypexpr(): if not expr: import pyparsing unicodePrintables = u''.join(unichr(c) for c in xrange(65536) if not unichr(c).isspace()) - txt = "".join(c for c in unicodePrintables if c not in '()&|!=') - expr = pyparsing.nestedExpr("(", ")", pyparsing.Word(txt) | pyparsing.oneOf("& | != =")) + txt = "".join(c for c in unicodePrintables if c not in '()&|<>!=') + expr = pyparsing.nestedExpr("(", ")", pyparsing.Word(txt) | pyparsing.oneOf("& | < > != =")) return expr def human_to_list(data):