summaryrefslogtreecommitdiff
path: root/sphinx/util/console.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2014-09-17 12:26:40 +0200
committerGeorg Brandl <georg@python.org>2014-09-17 12:26:40 +0200
commit1b71e6e2c8268a3352218a49411c222a55360053 (patch)
tree29c02d1d67b612d9523fef19e691a8efabafd92a /sphinx/util/console.py
parent02901ae02ffe5b4b20d874903276409622f14b73 (diff)
parent439018a4e6fc44ecc67bc52b3794fda735b1eb8d (diff)
downloadsphinx-git-1b71e6e2c8268a3352218a49411c222a55360053.tar.gz
merge with stable
Diffstat (limited to 'sphinx/util/console.py')
-rw-r--r--sphinx/util/console.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sphinx/util/console.py b/sphinx/util/console.py
index 2acc8eade..fa7a4a9f5 100644
--- a/sphinx/util/console.py
+++ b/sphinx/util/console.py
@@ -74,6 +74,9 @@ def coloron():
def colorize(name, text):
return codes.get(name, '') + text + codes.get('reset', '')
+def strip_colors(s):
+ return re.compile('\x1b.*?m').sub('', s)
+
def create_color_func(name):
def inner(text):
return colorize(name, text)