Skip to content

Commit 80f6d46

Browse files
committed
Updated comments.
1 parent 833341a commit 80f6d46

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

cmd2/cmd2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1196,7 +1196,7 @@ def visible_prompt(self) -> str:
11961196
Used by transcript testing to make it easier and more reliable when users are doing things like
11971197
coloring the prompt.
11981198
1199-
:return: the stripped prompt.
1199+
:return: the stripped prompt
12001200
"""
12011201
return su.strip_style(self.prompt)
12021202

cmd2/rich_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def rich_text_to_string(text: Text) -> str:
263263

264264

265265
def string_to_rich_text(text: str) -> Text:
266-
r"""Create a Text object from a string which can contain ANSI style sequences.
266+
r"""Create a Rich Text object from a string which can contain ANSI style sequences.
267267
268268
This wraps rich.Text.from_ansi() to handle an issue where it removes the
269269
trailing line break from a string (e.g. "Hello\n" becomes "Hello").
@@ -327,7 +327,7 @@ def prepare_objects_for_rendering(*objects: Any) -> tuple[Any, ...]:
327327
"""Prepare a tuple of objects for printing by Rich's Console.print().
328328
329329
This function converts any non-Rich object whose string representation contains
330-
ANSI style sequences into a rich.Text object. This ensures correct display width
330+
ANSI style sequences into a Rich Text object. This ensures correct display width
331331
calculation, as Rich can then properly parse and account for these non-printing
332332
codes. All other objects are left untouched, allowing Rich's native
333333
renderers to handle them.

cmd2/string_utils.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ def stylize(val: str, style: StyleType) -> str:
9696
def strip_style(val: str) -> str:
9797
"""Strip all ANSI style sequences from a string.
9898
99-
This function uses a regular expression to efficiently remove ANSI style
100-
sequences, which are a subset of ANSI escape sequences used for text formatting.
101-
10299
:param val: string to be stripped
103100
:return: the stripped string
104101
"""

0 commit comments

Comments
 (0)