summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authoralalazo <massimiliano.culpo@googlemail.com>2017-06-11 08:35:22 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2018-02-13 02:18:28 -0800
commit8e0f9038abd7166375245d92e07e0187c1d0edf3 (patch)
tree0e2492ee01f4c4369db07e4cd91e08f583ef4b08 /lib
parent28e129b087145e6a6cf4be40c25e76f8d69290e3 (diff)
downloadspack-8e0f9038abd7166375245d92e07e0187c1d0edf3.tar.gz
spack-8e0f9038abd7166375245d92e07e0187c1d0edf3.tar.bz2
spack-8e0f9038abd7166375245d92e07e0187c1d0edf3.tar.xz
spack-8e0f9038abd7166375245d92e07e0187c1d0edf3.zip
Improved naming of properties and classes (per Denis comments).
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/__init__.py4
-rw-r--r--lib/spack/spack/mixins.py16
2 files changed, 11 insertions, 9 deletions
diff --git a/lib/spack/spack/__init__.py b/lib/spack/spack/__init__.py
index 62ac793d90..83355ad28c 100644
--- a/lib/spack/spack/__init__.py
+++ b/lib/spack/spack/__init__.py
@@ -214,8 +214,8 @@ __all__ += [
'IntelPackage',
]
-from spack.mixins import FilterCompilerWrappersPackageMixin
-__all__ += ['FilterCompilerWrappersPackageMixin']
+import spack.mixins as mixins
+__all__ += ['mixins']
from spack.version import Version, ver
__all__ += ['Version', 'ver']
diff --git a/lib/spack/spack/mixins.py b/lib/spack/spack/mixins.py
index be3c2c3136..0a354362ce 100644
--- a/lib/spack/spack/mixins.py
+++ b/lib/spack/spack/mixins.py
@@ -27,14 +27,14 @@ import os
import llnl.util.filesystem
-class FilterCompilerWrappersPackageMixin(object):
+class FilterCompilerWrappers(object):
"""This mixin class registers a callback that filters a list of files
after installation and substitutes hardcoded paths pointing to the Spack
compiler wrappers with the corresponding 'real' compilers.
"""
#: compiler wrappers to be filtered (needs to be overridden)
- compiler_wrappers = []
+ to_be_filtered_for_wrappers = []
#: phase after which the callback is invoked (default 'install')
filter_phase = 'install'
@@ -43,7 +43,7 @@ class FilterCompilerWrappersPackageMixin(object):
attr_name = '_InstallPhase_{0}'.format(self.filter_phase)
- # Here we want to get the attribute directly from the class (noe from
+ # Here we want to get the attribute directly from the class (not from
# the instance), so that we can modify it and add the mixin method
phase = getattr(type(self), attr_name)
@@ -54,10 +54,10 @@ class FilterCompilerWrappersPackageMixin(object):
phase = getattr(type(self), attr_name)
phase.run_after.append(
- FilterCompilerWrappersPackageMixin.filter_compilers
+ FilterCompilerWrappers.filter_compilers
)
- super(FilterCompilerWrappersPackageMixin, self).__init__()
+ super(FilterCompilerWrappers, self).__init__()
def filter_compilers(self):
"""Substitutes any path referring to a Spack compiler wrapper
@@ -70,8 +70,10 @@ class FilterCompilerWrappersPackageMixin(object):
kwargs = {'ignore_absent': True, 'backup': False, 'string': True}
- if self.compiler_wrappers:
- x = llnl.util.filesystem.FileFilter(*self.compiler_wrappers)
+ if self.to_be_filtered_for_wrappers:
+ x = llnl.util.filesystem.FileFilter(
+ *self.to_be_filtered_for_wrappers
+ )
x.filter(os.environ['CC'], self.compiler.cc, **kwargs)
x.filter(os.environ['CXX'], self.compiler.cxx, **kwargs)