From c6c0eeb0ff0a1054aa0acd2a553da5206e193458 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 23 Mar 2021 00:28:11 +0100 Subject: [PATCH] better volflags presentation --- copyparty/up2k.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/copyparty/up2k.py b/copyparty/up2k.py index f764ce09..8c4fb542 100644 --- a/copyparty/up2k.py +++ b/copyparty/up2k.py @@ -225,9 +225,14 @@ class Up2k(object): _, flags = self._expr_idx_filter(flags) - a = "\033[0;36m{}:\033[1;30m{}" - a = [a.format(k, v) for k, v in sorted(flags.items())] - self.log(" ".join(a) + "\033[0m") + ft = "\033[0;32m{}{:.0}" + ff = "\033[0;35m{}{:.0}" + fv = "\033[0;36m{}:\033[1;30m{}" + a = [ + (ft if v is True else ff if v is False else fv).format(k, str(v)) + for k, v in flags.items() + ] + self.log(" ".join(sorted(a)) + "\033[0m") reg = {} path = os.path.join(ptop, ".hist", "up2k.snap")