summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index 1f25bc14ea..df0ab5c14d 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -195,7 +195,7 @@ class Platform(object):
name = self.back_os
return self.operating_sys.get(name, None)
-
+
@classmethod
def detect(self):
@@ -206,12 +206,15 @@ class Platform(object):
"""
raise NotImplementedError()
+
def __repr__(self):
return self.__str__()
+
def __str__(self):
return self.name
+
def _cmp_key(self):
t_keys = ''.join(str(t._cmp_key()) for t in
sorted(self.targets.values()))
@@ -338,7 +341,6 @@ class OperatingSystem(object):
d = {}
d['name'] = self.name
d['version'] = self.version
-
return d
@key_ordering
@@ -378,6 +380,11 @@ class Arch(object):
else:
return ''
+
+ def __contains__(self, string):
+ return string in str(self)
+
+
def _cmp_key(self):
if isinstance(self.platform, Platform):
platform = self.platform.name