summaryrefslogtreecommitdiff
path: root/lib/spack/llnl/util/tty
diff options
context:
space:
mode:
authorMatthew Krafczyk <krafczyk.matthew@gmail.com>2016-11-15 18:10:37 -0500
committerMatthew Krafczyk <krafczyk.matthew@gmail.com>2016-11-16 11:58:36 -0500
commit6c854246aaa0b2b62195617c5bbd906f20f82595 (patch)
treeed40d4f8fa23e20fc8f81ac75e1a697e999646ff /lib/spack/llnl/util/tty
parent8e6d890a19e557e86791da5905ed96c271a6f61f (diff)
downloadspack-6c854246aaa0b2b62195617c5bbd906f20f82595.tar.gz
spack-6c854246aaa0b2b62195617c5bbd906f20f82595.tar.bz2
spack-6c854246aaa0b2b62195617c5bbd906f20f82595.tar.xz
spack-6c854246aaa0b2b62195617c5bbd906f20f82595.zip
Fix some formatting errors caught by flake8.
Diffstat (limited to 'lib/spack/llnl/util/tty')
-rw-r--r--lib/spack/llnl/util/tty/__init__.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/spack/llnl/util/tty/__init__.py b/lib/spack/llnl/util/tty/__init__.py
index 07fe579a8c..03188ce592 100644
--- a/lib/spack/llnl/util/tty/__init__.py
+++ b/lib/spack/llnl/util/tty/__init__.py
@@ -67,12 +67,12 @@ def set_stacktrace(flag):
def process_stacktrace(countback):
- """Returns a string with the file and line of the stackframe 'countback' frames from the bottom of the stack"""
+ """Gives file and line frame 'countback' frames from the bottom"""
st = traceback.extract_stack()
- #First entry should be bin/spack. Use this to get spack 'root'.
- #bin/spack is 9 characters, the length of the 'root' is then len-9.
- root_len = len(st[0][0])-9
- st_idx = len(st)-countback-1
+ # First entry should be bin/spack. Use this to get spack 'root'.
+ # bin/spack is 9 characters, the length of the 'root' is then len-9.
+ root_len = len(st[0][0]) - 9
+ st_idx = len(st) - countback - 1
st_text = "%s:%i " % (st[st_idx][0][root_len:], st[st_idx][1])
return st_text
@@ -96,7 +96,8 @@ def info(message, *args, **kwargs):
st_text = ""
if _stacktrace:
st_text = process_stacktrace(st_countback)
- cprint("@%s{%s==>} %s" % (format, st_text, cescape(str(message))), stream=stream)
+ cprint("@%s{%s==>} %s" % (format, st_text, cescape(str(message))),
+ stream=stream)
for arg in args:
if wrap:
lines = textwrap.wrap(