summaryrefslogtreecommitdiff
path: root/lib/spack/llnl/util/tty/log.py
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2016-08-11 08:55:20 +0200
committeralalazo <massimiliano.culpo@googlemail.com>2016-08-11 08:55:20 +0200
commitb4b9ebe7d718d169dd5f2ab41d4cbc00fed88641 (patch)
treec6a4c9d60798a9502a6d1e2a6d0641a2041053ee /lib/spack/llnl/util/tty/log.py
parentb92deda41bf2995a8a7b717ea8149af7797e30d5 (diff)
parentf59653ac2c9b20ec5954d90fda019c7652644ac9 (diff)
downloadspack-b4b9ebe7d718d169dd5f2ab41d4cbc00fed88641.tar.gz
spack-b4b9ebe7d718d169dd5f2ab41d4cbc00fed88641.tar.bz2
spack-b4b9ebe7d718d169dd5f2ab41d4cbc00fed88641.tar.xz
spack-b4b9ebe7d718d169dd5f2ab41d4cbc00fed88641.zip
Merge branch 'develop' of https://github.com/LLNL/spack into features/install_with_phases
Conflicts: lib/spack/llnl/util/tty/log.py lib/spack/spack/__init__.py lib/spack/spack/cmd/install.py lib/spack/spack/cmd/setup.py lib/spack/spack/package.py var/spack/repos/builtin/packages/blitz/package.py var/spack/repos/builtin/packages/gmp/package.py var/spack/repos/builtin/packages/qhull/package.py var/spack/repos/builtin/packages/szip/package.py
Diffstat (limited to 'lib/spack/llnl/util/tty/log.py')
-rw-r--r--lib/spack/llnl/util/tty/log.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/spack/llnl/util/tty/log.py b/lib/spack/llnl/util/tty/log.py
index 747315f41c..25ed5254a5 100644
--- a/lib/spack/llnl/util/tty/log.py
+++ b/lib/spack/llnl/util/tty/log.py
@@ -37,6 +37,7 @@ import llnl.util.tty.color as color
# Use this to strip escape sequences
_escape = re.compile(r'\x1b[^m]*m|\x1b\[?1034h')
+
def _strip(line):
"""Strip color and control characters from a line."""
return _escape.sub('', line)
@@ -59,10 +60,10 @@ class keyboard_input(object):
When the with block completes, this will restore settings before
canonical and echo were disabled.
"""
+
def __init__(self, stream):
self.stream = stream
-
def __enter__(self):
self.old_cfg = None
@@ -87,10 +88,9 @@ class keyboard_input(object):
# Apply new settings for terminal
termios.tcsetattr(fd, termios.TCSADRAIN, self.new_cfg)
- except Exception, e:
+ except Exception:
pass # Some OS's do not support termios, so ignore.
-
def __exit__(self, exc_type, exception, traceback):
# If termios was avaialble, restore old settings after the
# with block