diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-09-26 12:54:40 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-26 12:54:40 -0400 |
commit | 303733526d7335133f7f2dc55f54dca410a9f1de (patch) | |
tree | 72cdffa820e29e15b32f6aa88a173c50ee1218c9 /examples/python_scripting.py | |
parent | 982d2f2c2b91c04ecd2ba45dc2f6e1d26d77e4c1 (diff) | |
parent | 354cee41b786a7e4088512aa1a95dfce8da89935 (diff) | |
download | cmd2-git-303733526d7335133f7f2dc55f54dca410a9f1de.tar.gz |
Merge pull request #516 from python-cmd2/colorize
Colorize
Diffstat (limited to 'examples/python_scripting.py')
-rwxr-xr-x | examples/python_scripting.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/examples/python_scripting.py b/examples/python_scripting.py index 4c959f58..0b0030a5 100755 --- a/examples/python_scripting.py +++ b/examples/python_scripting.py @@ -17,6 +17,8 @@ This application and the "scripts/conditional.py" script serve as an example for import argparse import os +from colorama import Fore + import cmd2 @@ -33,7 +35,7 @@ class CmdLineApp(cmd2.Cmd): def _set_prompt(self): """Set prompt so it displays the current working directory.""" self.cwd = os.getcwd() - self.prompt = self.colorize('{!r} $ '.format(self.cwd), 'cyan') + self.prompt = Fore.CYAN + '{!r} $ '.format(self.cwd) + Fore.RESET def postcmd(self, stop: bool, line: str) -> bool: """Hook method executed just after a command dispatch is finished. |