summaryrefslogtreecommitdiffstats
path: root/gita/info.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-03 09:16:38 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-05-03 09:16:38 +0000
commit9c4b870e75ec43120e43968462515790e646de10 (patch)
treed8f80fcf7014fc01bd7f79a32e7e348aa68660ff /gita/info.py
parentReleasing debian version 0.16.2-2. (diff)
downloadgita-9c4b870e75ec43120e43968462515790e646de10.tar.xz
gita-9c4b870e75ec43120e43968462515790e646de10.zip
Merging upstream version 0.16.3.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'gita/info.py')
-rw-r--r--gita/info.py8
1 files changed, 7 insertions, 1 deletions
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,