Change formatting

This commit is contained in:
Midgard 2020-07-11 23:35:47 +02:00
parent 6197212f2b
commit 4484ae670f
Signed by untrusted user who does not match committer: midgard
GPG key ID: 511C112F1331BBB4

View file

@ -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 "" repo = f"::{info['repo']}" if info["repo"] != default_repo else ""
name = f"{name_version}{category_colour}{repo}" 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 "")