diff options
Diffstat (limited to 'gita/info.py')
-rw-r--r-- | gita/info.py | 8 |
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, |