Document underline() and bold() - wr - Translate a term via WordReference.com
(HTM) hg clone https://bitbucket.org/iamleot/wr
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
---
(DIR) changeset d764e06650895d8b9851b047af1e0bc6d062c5f5
(DIR) parent 248ac1bb951d9f36479205ac551ad1b01d4f43b6
(HTM) Author: Leonardo Taccari <iamleot@gmail.com>
Date: Thu, 28 Nov 2019 14:48:49
Document underline() and bold()
Diffstat:
wr.py | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff -r 248ac1bb951d -r d764e0665089 wr.py
--- a/wr.py Thu Nov 28 12:14:29 2019 +0100
+++ b/wr.py Thu Nov 28 14:48:49 2019 +0100
@@ -209,6 +209,11 @@
def underline(text: str, ansi_escape: bool = False) -> str:
+ """Underline via ANSI escape characters text
+
+ Given `text', underline it via ANSI escape characters if `ansi_escape' is
+ True, otherwise return it unmodified.
+ """
if ansi_escape:
return '\033[4m{text}\033[0m'.format(text=text)
else:
@@ -216,6 +221,11 @@
def bold(text: str, ansi_escape: bool = False) -> str:
+ """Bold via ANSI escape characters text
+
+ Given `text', bold it via ANSI escape characters if `ansi_escape' is
+ True, otherwise return it unmodified.
+ """
if ansi_escape:
return '\033[1m{text}\033[0m'.format(text=text)
else: