diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-02-04 21:57:05 -0500 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2020-02-04 21:57:05 -0500 |
commit | 457123d3a1376a2ab713f0ff638313b0eacfcf3e (patch) | |
tree | ecffdeb48fdac5fe7a17c38c555ae932c9b89f64 /cmd2/cmd2.py | |
parent | a5d3f7959c252ee23cf6360b81292d376b8c6fcc (diff) | |
download | cmd2-git-457123d3a1376a2ab713f0ff638313b0eacfcf3e.tar.gz |
Updated CHANGELOG and made a few minor tweaks
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 10 |
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, |