From 9c4b870e75ec43120e43968462515790e646de10 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 3 May 2023 11:16:38 +0200 Subject: Merging upstream version 0.16.3. Signed-off-by: Daniel Baumann --- gita/info.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'gita/info.py') diff --git a/gita/info.py b/gita/info.py index ee302d0..57bb1a8 100644 --- a/gita/info.py +++ b/gita/info.py @@ -9,7 +9,7 @@ from typing import Tuple, List, Callable, Dict from . import common -class Color(str, Enum): +class Color(Enum): """ Terminal color """ @@ -32,6 +32,12 @@ class Color(str, Enum): b_white = '\x1b[37;1m' underline = '\x1B[4m' + # Make f"{Color.foo}" expand to Color.foo.value . + # + # See https://stackoverflow.com/a/24487545 + def __str__(self): + return f"{self.value}" + default_colors = { 'no-remote': Color.white.name, -- cgit v1.2.3