From eabf05b3b5c7c5e0b139e8143d02e6f6afe9000a Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Tue, 10 Sep 2024 02:04:11 +0200 Subject: [PATCH] In browser.py number filtering, allow whitespace-free commands. --- browser.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/browser.py b/browser.py index 9de8ca7..65aa290 100755 --- a/browser.py +++ b/browser.py @@ -459,9 +459,16 @@ class MainWindow(Gtk.Window): for constraint_string in constraint_strings: toks = constraint_string.split() if len(toks) == 1: - value = float(toks[0]) if use_float else int(toks[0]) - numbers_or.add(value) - elif len(toks) == 2: + tok = toks[0] + if tok[0] in '<>!': + if '=' == tok[1]: + toks = [tok[:2], tok[2:]] + else: + toks = [tok[:1], tok[1:]] + else: + value = float(tok) if use_float else int(tok) + numbers_or.add(value) + if len(toks) == 2: value = float(toks[1]) if use_float else int(toks[1]) if toks[0] == '!=': unequal.add(value) -- 2.30.2