diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-18 14:32:49 -0400 |
---|---|---|
committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2018-10-18 14:32:49 -0400 |
commit | 6a8af758ffd4c0f06812ca52abe5ddd1d8891bd9 (patch) | |
tree | d78fbd91f9ea106730bce9bb6390347cf003d51f /cmd2/cmd2.py | |
parent | aad1219701140498187723b40f4da5606ace800d (diff) | |
download | cmd2-git-6a8af758ffd4c0f06812ca52abe5ddd1d8891bd9.tar.gz |
Deleted Cmd.colorize() method and Cmd._colorcodes dictionary which were deprecated in 0.9.5
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 8cc5496f..e08db8c5 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -436,15 +436,6 @@ class Cmd(cmd.Cmd): # Codes used for exit conditions self._STOP_AND_EXIT = True # cmd convention - self._colorcodes = {'bold': {True: '\x1b[1m', False: '\x1b[22m'}, - 'cyan': {True: Fore.CYAN, False: Fore.RESET}, - 'blue': {True: Fore.BLUE, False: Fore.RESET}, - 'red': {True: Fore.RED, False: Fore.RESET}, - 'magenta': {True: Fore.MAGENTA, False: Fore.RESET}, - 'green': {True: Fore.GREEN, False: Fore.RESET}, - 'underline': {True: '\x1b[4m', False: Fore.RESET}, - 'yellow': {True: Fore.YELLOW, False: Fore.RESET}} - # Used load command to store the current script dir as a LIFO queue to support _relative_load command self._script_dir = [] @@ -714,17 +705,6 @@ class Cmd(cmd.Cmd): if self.broken_pipe_warning: sys.stderr.write(self.broken_pipe_warning) - def colorize(self, val: str, color: str) -> str: - """Given a string (``val``), returns that string wrapped in UNIX-style - special characters that turn on (and then off) text color and style. - If the ``colors`` environment parameter is ``False``, or the application - is running on Windows, will return ``val`` unchanged. - ``color`` should be one of the supported strings (or styles): - red/blue/green/cyan/magenta, bold, underline""" - if self.colors.lower() != constants.COLORS_NEVER.lower() and (self.stdout == self.initial_stdout): - return self._colorcodes[color][True] + val + self._colorcodes[color][False] - return val - # ----- Methods related to tab completion ----- def reset_completion_defaults(self) -> None: |