summaryrefslogtreecommitdiff
path: root/sphinx/util/console.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-05-26 00:25:41 +0200
committerGeorg Brandl <georg@python.org>2010-05-26 00:25:41 +0200
commit04768d4e8f9f215a72596026d1f9a019debd0872 (patch)
treefeb597309afeb5095b05a16c6192cc02c53c8648 /sphinx/util/console.py
parent7353c27cccf133a662dcc039ca8c2d9e56b3f60f (diff)
downloadsphinx-04768d4e8f9f215a72596026d1f9a019debd0872.tar.gz
Fix long lines.
Diffstat (limited to 'sphinx/util/console.py')
-rw-r--r--sphinx/util/console.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/sphinx/util/console.py b/sphinx/util/console.py
index 381803bc..b0f03921 100644
--- a/sphinx/util/console.py
+++ b/sphinx/util/console.py
@@ -13,7 +13,7 @@ import os
import sys
import re
-_strip_core_re = re.compile('\x1b\\[(\\d\\d;){0,2}\\d\\dm')
+_ansi_re = re.compile('\x1b\\[(\\d\\d;){0,2}\\d\\dm')
codes = {}
def get_terminal_width():
@@ -38,8 +38,8 @@ def term_width_line(text):
# if no coloring, don't output fancy backspaces
return text + '\n'
else:
- # codes are not displayed and must be taken into account by introducing the correction factor
- return text.ljust(_tw + len(text) - len(_strip_core_re.sub('', text))) + '\r'
+ # codes are not displayed, this must be taken into account
+ return text.ljust(_tw + len(text) - len(_ansi_re.sub('', text))) + '\r'
def color_terminal():
if not hasattr(sys.stdout, 'isatty'):