summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-25 22:38:49 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-06-25 22:38:49 -0400
commit4d2267322b7ac206692bc5ed8fa2ee0dd2ea5e26 (patch)
tree2ff7325f2e3c91ce9e01aab4c7517176665f4424 /examples
parent1be669baed037a1b7a0647242532b2867a3b8ba8 (diff)
downloadcmd2-git-4d2267322b7ac206692bc5ed8fa2ee0dd2ea5e26.tar.gz
Removed color args from poutput since the style function is going to do more than color
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/pirate.py16
1 files changed, 2 insertions, 14 deletions
diff --git a/examples/pirate.py b/examples/pirate.py
index 57ac0b53..6802edb6 100755
--- a/examples/pirate.py
+++ b/examples/pirate.py
@@ -8,22 +8,10 @@ It demonstrates many features of cmd2.
"""
import argparse
-from colorama import Fore
-
import cmd2
+from cmd2 import utils
from cmd2.constants import MULTILINE_TERMINATOR
-COLORS = {
- 'black': Fore.BLACK,
- 'red': Fore.RED,
- 'green': Fore.GREEN,
- 'yellow': Fore.YELLOW,
- 'blue': Fore.BLUE,
- 'magenta': Fore.MAGENTA,
- 'cyan': Fore.CYAN,
- 'white': Fore.WHITE,
-}
-
class Pirate(cmd2.Cmd):
"""A piratical example cmd2 application involving looting and drinking."""
@@ -82,7 +70,7 @@ class Pirate(cmd2.Cmd):
def do_sing(self, arg):
"""Sing a colorful song."""
- self.poutput(arg, fg=self.songcolor)
+ self.poutput(utils.style_message(arg, fg=self.songcolor))
yo_parser = argparse.ArgumentParser()
yo_parser.add_argument('--ho', type=int, default=2, help="How often to chant 'ho'")