diff options
| author | blasty <peter@haxx.in> | 2026-08-21 12:14:46 +0200 |
|---|---|---|
| committer | blasty <peter@haxx.in> | 2026-08-21 12:15:15 +0200 |
| commit | 02d02417800184fb76cd0245cdaa94c437aa4081 (patch) | |
| tree | 7589e6e2e8426bb7370fc56eee52d1559c9d7e57 /idatui/search.py | |
| parent | adopt ruff: pinned formatter + import sorting, opt-in pre-commit hook (diff) | |
| download | ida-tui-02d02417800184fb76cd0245cdaa94c437aa4081.tar.gz ida-tui-02d02417800184fb76cd0245cdaa94c437aa4081.tar.xz ida-tui-02d02417800184fb76cd0245cdaa94c437aa4081.zip | |
reformat: ruff format + import sort, mechanically (see ruff.toml)
No behavior. Listed in .git-blame-ignore-revs (next commit).
Diffstat (limited to 'idatui/search.py')
| -rw-r--r-- | idatui/search.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/idatui/search.py b/idatui/search.py index feb7e3d..ba8c692 100644 --- a/idatui/search.py +++ b/idatui/search.py @@ -69,7 +69,7 @@ def classify(query: str, forced: str | None = None) -> tuple[str, str]: low = q.lower() for prefix, mode in (("hex:", BYTES), ("bytes:", BYTES), ("text:", TEXT)): if low.startswith(prefix): - return (mode, q[len(prefix):].strip()) + return (mode, q[len(prefix) :].strip()) if forced in (TEXT, BYTES): return (forced, q) if looks_like_bytes(q) or probably_meant_bytes(q): @@ -89,7 +89,7 @@ def normalise_pattern(pattern: str) -> str: q = q.replace(",", " ") # "488B??C3" -- a bare hex run with no separators at all. if " " not in q and len(q) > 2 and len(q) % 2 == 0: - q = " ".join(q[i:i + 2] for i in range(0, len(q), 2)) + q = " ".join(q[i : i + 2] for i in range(0, len(q), 2)) return " ".join(q.split()) @@ -107,6 +107,7 @@ def pattern_problem(pattern: str) -> str | None: tokens = [t for t in q.split() if t] bad = [t for t in tokens if not _TOKEN.match(t)] if bad: - return (f"{bad[0]!r} is not a byte: use hex pairs, ? wildcards " - 'or a "quoted string"') + return ( + f'{bad[0]!r} is not a byte: use hex pairs, ? wildcards or a "quoted string"' + ) return None |
