summaryrefslogtreecommitdiff
path: root/lib/spack/llnl/util/tty/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/spack/llnl/util/tty/__init__.py')
-rw-r--r--lib/spack/llnl/util/tty/__init__.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/spack/llnl/util/tty/__init__.py b/lib/spack/llnl/util/tty/__init__.py
index ee81e11a20..db74aaba6b 100644
--- a/lib/spack/llnl/util/tty/__init__.py
+++ b/lib/spack/llnl/util/tty/__init__.py
@@ -36,6 +36,7 @@ _debug = False
_verbose = False
indent = " "
+
def is_verbose():
return _verbose
@@ -148,7 +149,8 @@ def get_yes_or_no(prompt, **kwargs):
elif default_value is False:
prompt += ' [y/N] '
else:
- raise ValueError("default for get_yes_no() must be True, False, or None.")
+ raise ValueError(
+ "default for get_yes_no() must be True, False, or None.")
result = None
while result is None:
@@ -174,8 +176,9 @@ def hline(label=None, **kwargs):
char = kwargs.pop('char', '-')
max_width = kwargs.pop('max_width', 64)
if kwargs:
- raise TypeError("'%s' is an invalid keyword argument for this function."
- % next(kwargs.iterkeys()))
+ raise TypeError(
+ "'%s' is an invalid keyword argument for this function."
+ % next(kwargs.iterkeys()))
rows, cols = terminal_size()
if not cols:
@@ -200,7 +203,8 @@ def terminal_size():
"""Gets the dimensions of the console: (rows, cols)."""
def ioctl_GWINSZ(fd):
try:
- rc = struct.unpack('hh', fcntl.ioctl(fd, termios.TIOCGWINSZ, '1234'))
+ rc = struct.unpack('hh', fcntl.ioctl(
+ fd, termios.TIOCGWINSZ, '1234'))
except:
return
return rc