diff options
Diffstat (limited to 'examples/colors.py')
-rwxr-xr-x | examples/colors.py | 14 |
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') |