home · contact · privacy
In browser.py number filtering, allow whitespace-free commands.
authorChristian Heller <c.heller@plomlompom.de>
Tue, 10 Sep 2024 00:04:11 +0000 (02:04 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Tue, 10 Sep 2024 00:04:11 +0000 (02:04 +0200)
browser.py

index 9de8ca7cb2b56ccf51b31cfbcc43fbc41e100d7c..65aa290decf7d4fecb09ded37e530de78cac420f 100755 (executable)
@@ -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)