diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-26 10:36:24 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-06-26 10:36:24 -0400 |
commit | 72044030810dd293699a6bae8853e1cfd0b4887b (patch) | |
tree | f389fd97625c55e161cf04ac7e879422a2b19e9a /examples | |
parent | e34bba44ef53228aeba613ac6e928b2c315111cf (diff) | |
download | cmd2-git-72044030810dd293699a6bae8853e1cfd0b4887b.tar.gz |
Added TextStyle class and default implementations for various message types like Warning, Error, and Succes
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/pirate.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/pirate.py b/examples/pirate.py index 0d9d89bc..fad6e2c9 100755 --- a/examples/pirate.py +++ b/examples/pirate.py @@ -9,6 +9,7 @@ It demonstrates many features of cmd2. import argparse import cmd2 +import cmd2.ansi from cmd2.constants import MULTILINE_TERMINATOR @@ -69,7 +70,7 @@ class Pirate(cmd2.Cmd): def do_sing(self, arg): """Sing a colorful song.""" - self.poutput(cmd2.ansi.style(arg, fg=self.songcolor)) + self.poutput(cmd2.ansi.style(arg, cmd2.ansi.TextStyle(fg=self.songcolor))) yo_parser = argparse.ArgumentParser() yo_parser.add_argument('--ho', type=int, default=2, help="How often to chant 'ho'") |