summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorkotfu <kotfu@kotfu.net>2019-11-24 10:31:51 -0700
committerkotfu <kotfu@kotfu.net>2019-11-24 10:31:51 -0700
commit7175181a8dfe3d0b5b620a12338912625e1d0045 (patch)
treeb38f1c7ad9315e97a786ee3f837cb068c04cd0e7 /cmd2
parent8b2b537b5f61ee29d1952d86615bfa99704379de (diff)
downloadcmd2-git-7175181a8dfe3d0b5b620a12338912625e1d0045.tar.gz
Fix minor errors in docstrings
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/ansi.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cmd2/ansi.py b/cmd2/ansi.py
index f1b2def8..32d01399 100644
--- a/cmd2/ansi.py
+++ b/cmd2/ansi.py
@@ -91,6 +91,7 @@ def ansi_safe_wcswidth(text: str) -> int:
Wrap wcswidth to make it compatible with strings that contains ANSI escape sequences
:param text: the string being measured
+ :return: the width of the string when printed to the terminal
"""
# Strip ANSI escape sequences since they cause wcswidth to return -1
return wcswidth(strip_ansi(text))
@@ -114,7 +115,7 @@ def fg_lookup(fg_name: str) -> str:
:param fg_name: foreground color name to look up ANSI escape code(s) for
:return: ANSI escape code(s) associated with this color
- :raises ValueError if the color cannot be found
+ :raises ValueError: if the color cannot be found
"""
try:
ansi_escape = FG_COLORS[fg_name.lower()]
@@ -128,7 +129,7 @@ def bg_lookup(bg_name: str) -> str:
:param bg_name: background color name to look up ANSI escape code(s) for
:return: ANSI escape code(s) associated with this color
- :raises ValueError if the color cannot be found
+ :raises ValueError: if the color cannot be found
"""
try:
ansi_escape = BG_COLORS[bg_name.lower()]
@@ -246,6 +247,6 @@ def set_title_str(title: str) -> str:
"""Get the required string, including ANSI escape codes, for setting window title for the terminal.
:param title: new title for the window
- :return string to write to sys.stderr in order to set the window title to the desired test
+ :return: string to write to sys.stderr in order to set the window title to the desired test
"""
return colorama.ansi.set_title(title)