From 4d2267322b7ac206692bc5ed8fa2ee0dd2ea5e26 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Tue, 25 Jun 2019 22:38:49 -0400 Subject: Removed color args from poutput since the style function is going to do more than color --- examples/pirate.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'examples') 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'") -- cgit v1.2.1