diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-12-19 17:00:29 -0500 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2019-12-19 17:00:29 -0500 |
commit | b0e5aabad9c902ee5d664bf58885245060114f61 (patch) | |
tree | daf52ea8ffc62dc3eff706109c9d21ac9b69e197 /cmd2/cmd2.py | |
parent | 1a26c0254b2c2834998b8a28f04e8aedc08c587f (diff) | |
download | cmd2-git-b0e5aabad9c902ee5d664bf58885245060114f61.tar.gz |
Renamed ansi_safe_wcswidth() to style_aware_wcswidth()
Renamed ansi_aware_write() to style_aware_write()
Diffstat (limited to 'cmd2/cmd2.py')
-rw-r--r-- | cmd2/cmd2.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cmd2/cmd2.py b/cmd2/cmd2.py index 8a97761d..f133381b 100644 --- a/cmd2/cmd2.py +++ b/cmd2/cmd2.py @@ -439,7 +439,7 @@ class Cmd(cmd.Cmd): :param end: string appended after the end of the message, default a newline """ try: - ansi.ansi_aware_write(self.stdout, "{}{}".format(msg, end)) + ansi.style_aware_write(self.stdout, "{}{}".format(msg, end)) except BrokenPipeError: # This occurs if a command's output is being piped to another # process and that process closes before the command is @@ -462,7 +462,7 @@ class Cmd(cmd.Cmd): final_msg = ansi.style_error(msg) else: final_msg = "{}".format(msg) - ansi.ansi_aware_write(sys.stderr, final_msg + end) + ansi.style_aware_write(sys.stderr, final_msg + end) def pwarning(self, msg: Any = '', *, end: str = '\n', apply_style: bool = True) -> None: """Wraps perror, but applies ansi.style_warning by default @@ -1096,7 +1096,7 @@ class Cmd(cmd.Cmd): longest_match_length = 0 for cur_match in matches_to_display: - cur_length = ansi.ansi_safe_wcswidth(cur_match) + cur_length = ansi.style_aware_wcswidth(cur_match) if cur_length > longest_match_length: longest_match_length = cur_length else: @@ -2653,7 +2653,7 @@ class Cmd(cmd.Cmd): widest = 0 # measure the commands for command in cmds: - width = ansi.ansi_safe_wcswidth(command) + width = ansi.style_aware_wcswidth(command) if width > widest: widest = width # add a 4-space pad @@ -3737,7 +3737,7 @@ class Cmd(cmd.Cmd): test_results = runner.run(testcase) execution_time = time.time() - start_time if test_results.wasSuccessful(): - ansi.ansi_aware_write(sys.stderr, stream.read()) + ansi.style_aware_write(sys.stderr, stream.read()) finish_msg = ' {0} transcript{1} passed in {2:.3f} seconds '.format(num_transcripts, plural, execution_time) finish_msg = ansi.style_success(utils.align_center(finish_msg, fill_char='=')) self.poutput(finish_msg) |