summaryrefslogtreecommitdiff
path: root/examples/colors.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-09 22:45:53 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-09 22:45:53 -0500
commit591bd29cb4a3bcb9b1f40ffc1f30429c6501ebdb (patch)
tree46c1e3af762c9cb222c6ae90bf0446d6eca4b388 /examples/colors.py
parent10b844809e3a9500274dc4af4e780708975ba905 (diff)
parentd4556962799e68ea4d54ff86186428d17edcaef9 (diff)
downloadcmd2-git-591bd29cb4a3bcb9b1f40ffc1f30429c6501ebdb.tar.gz
Merge branch 'master' into generating_output_docs
# Conflicts: # docs/features/generating_output.rst # docs/features/settings.rst
Diffstat (limited to 'examples/colors.py')
-rwxr-xr-xexamples/colors.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/examples/colors.py b/examples/colors.py
index 7a4d15e6..bbb3b2ad 100755
--- a/examples/colors.py
+++ b/examples/colors.py
@@ -6,21 +6,21 @@ A sample application for cmd2. Demonstrating colorized output.
Experiment with the command line options on the `speak` command to see how
different output colors ca
-The allow_ansi setting has three possible values:
+The allow_style setting has three possible values:
Never
- poutput(), pfeedback(), and ppaged() strip all ANSI escape sequences
+ poutput(), pfeedback(), and ppaged() strip all ANSI style sequences
which instruct the terminal to colorize output
Terminal
(the default value) poutput(), pfeedback(), and ppaged() do not strip any
- ANSI escape sequences when the output is a terminal, but if the output is
- a pipe or a file the escape sequences are stripped. If you want colorized
- output you must add ANSI escape sequences using either cmd2's internal ansi
+ ANSI style sequences when the output is a terminal, but if the output is
+ a pipe or a file the style sequences are stripped. If you want colorized
+ output you must add ANSI style sequences using either cmd2's internal ansi
module or another color library such as `plumbum.colors` or `colorama`.
Always
- poutput(), pfeedback(), and ppaged() never strip ANSI escape sequences,
+ poutput(), pfeedback(), and ppaged() never strip ANSI style sequences,
regardless of the output destination
"""
import argparse
@@ -42,7 +42,7 @@ class CmdLineApp(cmd2.Cmd):
self.settable['maxrepeats'] = 'max repetitions for speak command'
# Should ANSI color output be allowed
- self.allow_ansi = ansi.ANSI_TERMINAL
+ self.allow_style = ansi.STYLE_TERMINAL
speak_parser = argparse.ArgumentParser()
speak_parser.add_argument('-p', '--piglatin', action='store_true', help='atinLay')