From 4484ae670fcf7c9b0504a4e760c1067848ab4c97 Mon Sep 17 00:00:00 2001 From: Midgard <2885-Midgard@users.noreply.framagit.org> Date: Sat, 11 Jul 2020 23:35:47 +0200 Subject: [PATCH] Change formatting --- pyesearch.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyesearch.py b/pyesearch.py index d6e9025..194700c 100755 --- a/pyesearch.py +++ b/pyesearch.py @@ -151,9 +151,9 @@ def format_item(info, longest_cat=0, longest_namever=0, default_repo=None): repo = f"::{info['repo']}" if info["repo"] != default_repo else "" name = f"{name_version}{category_colour}{repo}" - filler = ("\x1b[90m " + ("╴" * (longest_namever - len(name_version) - len(repo)))) if info["description"] else "" + filler = (f"\x1b[{'92' if info['installed'] else '90'}m " + ("." * (longest_namever - len(name_version) - len(repo)))) if info["description"] else "" - return f"{category_colour}{info['category']:>{longest_cat}}/{name_colour}{name}{filler}" + (f"╴{category_colour}─ \x1b[0m{info['description']}" if info["description"] else "") + return f"{category_colour}{info['category']:>{longest_cat}}/{name_colour}{name}{filler}" + ("\x1b[0m" if not info["installed"] else "") + (f" {info['description']}" if info["description"] else "")