summaryrefslogtreecommitdiff
path: root/cmd2/cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-04 21:57:05 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-02-04 21:57:05 -0500
commit457123d3a1376a2ab713f0ff638313b0eacfcf3e (patch)
treeecffdeb48fdac5fe7a17c38c555ae932c9b89f64 /cmd2/cmd2.py
parenta5d3f7959c252ee23cf6360b81292d376b8c6fcc (diff)
downloadcmd2-git-457123d3a1376a2ab713f0ff638313b0eacfcf3e.tar.gz
Updated CHANGELOG and made a few minor tweaks
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r--cmd2/cmd2.py10
1 files changed, 3 insertions, 7 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py
index 52971ddd..ccd96991 100644
--- a/cmd2/cmd2.py
+++ b/cmd2/cmd2.py
@@ -415,13 +415,9 @@ class Cmd(cmd.Cmd):
@allow_style.setter
def allow_style(self, new_val: str) -> None:
"""Setter property needed to support do_set when it updates allow_style"""
- new_val = new_val.lower()
- if new_val == ansi.STYLE_TERMINAL.lower():
- ansi.allow_style = ansi.STYLE_TERMINAL
- elif new_val == ansi.STYLE_ALWAYS.lower():
- ansi.allow_style = ansi.STYLE_ALWAYS
- elif new_val == ansi.STYLE_NEVER.lower():
- ansi.allow_style = ansi.STYLE_NEVER
+ new_val = new_val.capitalize()
+ if new_val in [ansi.STYLE_TERMINAL, ansi.STYLE_ALWAYS, ansi.STYLE_NEVER]:
+ ansi.allow_style = new_val
else:
raise ValueError('Invalid value: {} (valid values: {}, {}, {})'.format(new_val, ansi.STYLE_TERMINAL,
ansi.STYLE_ALWAYS,