From 20e4038a726e7b938a6bc5ab196156e0bf0becab Mon Sep 17 00:00:00 2001 From: Todd Gamblin Date: Wed, 27 Jun 2018 09:31:21 -0700 Subject: style: make core comply with pep8-naming --- lib/spack/llnl/util/lang.py | 4 ++-- lib/spack/llnl/util/multiproc.py | 6 +++--- lib/spack/llnl/util/tty/__init__.py | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/spack/llnl') diff --git a/lib/spack/llnl/util/lang.py b/lib/spack/llnl/util/lang.py index edba6e38e1..4d238217a1 100644 --- a/lib/spack/llnl/util/lang.py +++ b/lib/spack/llnl/util/lang.py @@ -282,8 +282,8 @@ class HashableMap(collections.MutableMapping): def copy(self): """Type-agnostic clone method. Preserves subclass type.""" # Construct a new dict of my type - T = type(self) - clone = T() + self_type = type(self) + clone = self_type() # Copy everything from this dict into it. for key in self: diff --git a/lib/spack/llnl/util/multiproc.py b/lib/spack/llnl/util/multiproc.py index 2bf5d1a200..26902d02ee 100644 --- a/lib/spack/llnl/util/multiproc.py +++ b/lib/spack/llnl/util/multiproc.py @@ -39,10 +39,10 @@ def spawn(f): return fun -def parmap(f, X): - pipe = [Pipe() for x in X] +def parmap(f, elements): + pipe = [Pipe() for x in elements] proc = [Process(target=spawn(f), args=(c, x)) - for x, (p, c) in zip(X, pipe)] + for x, (p, c) in zip(elements, pipe)] [p.start() for p in proc] [p.join() for p in proc] return [p.recv() for (p, c) in pipe] diff --git a/lib/spack/llnl/util/tty/__init__.py b/lib/spack/llnl/util/tty/__init__.py index d8e5f35379..5bf4e0f8ba 100644 --- a/lib/spack/llnl/util/tty/__init__.py +++ b/lib/spack/llnl/util/tty/__init__.py @@ -246,18 +246,18 @@ def hline(label=None, **kwargs): def terminal_size(): """Gets the dimensions of the console: (rows, cols).""" - def ioctl_GWINSZ(fd): + def ioctl_gwinsz(fd): try: rc = struct.unpack('hh', fcntl.ioctl( fd, termios.TIOCGWINSZ, '1234')) except BaseException: return return rc - rc = ioctl_GWINSZ(0) or ioctl_GWINSZ(1) or ioctl_GWINSZ(2) + rc = ioctl_gwinsz(0) or ioctl_gwinsz(1) or ioctl_gwinsz(2) if not rc: try: fd = os.open(os.ctermid(), os.O_RDONLY) - rc = ioctl_GWINSZ(fd) + rc = ioctl_gwinsz(fd) os.close(fd) except BaseException: pass -- cgit v1.2.3-70-g09d2