summaryrefslogtreecommitdiff
path: root/cmd2/ansi.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-07 11:32:18 -0500
committerKevin Van Brunt <kmvanbrunt@gmail.com>2020-02-07 11:32:18 -0500
commita73d30035c212cefab1c11c33d943d616728ce89 (patch)
tree2bb9c5ccf97bcc29ce253cd52057efba6df888c3 /cmd2/ansi.py
parent10b9f3eefa8eb0def7982d9e6b8245af6f0bf2d6 (diff)
downloadcmd2-git-a73d30035c212cefab1c11c33d943d616728ce89.tar.gz
Simplified ColorBase.__add__()
Diffstat (limited to 'cmd2/ansi.py')
-rw-r--r--cmd2/ansi.py6
1 files changed, 0 insertions, 6 deletions
diff --git a/cmd2/ansi.py b/cmd2/ansi.py
index 8cbf7e37..27086d4a 100644
--- a/cmd2/ansi.py
+++ b/cmd2/ansi.py
@@ -32,14 +32,8 @@ class ColorBase(Enum):
Base class for fg and bg classes
This expects the child classes to define enums of: color name -> ANSI color sequence
"""
- def __str__(self) -> str:
- """Return ANSI color sequence instead of enum name"""
- return self.value
-
def __add__(self, other: Any) -> str:
"""Return self + other as string"""
- if isinstance(other, (fg, bg)):
- other = str(other)
return self.value + other
def __radd__(self, other: Any) -> str: