summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMario Melara <maamelara@gmail.com>2016-02-24 15:30:20 -0800
committerMario Melara <maamelara@gmail.com>2016-02-24 15:30:20 -0800
commit9e844d974c2bce42b3e6e647c16b10aa122e54ce (patch)
tree733392b3c6e389e87d2a365b7f1cc0000d6ff75c /lib
parent77799741430796974809fce0f08d099303ec6da6 (diff)
downloadspack-9e844d974c2bce42b3e6e647c16b10aa122e54ce.tar.gz
spack-9e844d974c2bce42b3e6e647c16b10aa122e54ce.tar.bz2
spack-9e844d974c2bce42b3e6e647c16b10aa122e54ce.tar.xz
spack-9e844d974c2bce42b3e6e647c16b10aa122e54ce.zip
Added comments. Need to figure out how to make arch_tuple from_dict
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/architecture.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/spack/spack/architecture.py b/lib/spack/spack/architecture.py
index f0fc00242c..4b24680501 100644
--- a/lib/spack/spack/architecture.py
+++ b/lib/spack/spack/architecture.py
@@ -250,7 +250,8 @@ class Arch(namedtuple("Arch", "platform platform_os target")):
def _helper_to_dict(arch_field_dict, arch_field_name, *args):
""" General method to turn each class in architecture into a
- dictionary. Takes as argument the class dictionary,
+ dictionary. Takes as argument the class dictionary, the field name
+ (platform, platform_os, target) and then any attribute args
"""
d = {}
d[arch_field_name] = {}
@@ -294,10 +295,11 @@ def _target_from_dict(target):
return target
def _operating_system_from_dict(os_dict):
+ #TODO: Have a way to recognize the OS subclasses
name = os_dict['name']
os_list = all_platforms(True)
- os_classes = {o.__name__.lower():o for o in os_list}
- return os_classes[name]()
+ os_classes = {o.__name__:o for o in os_list}
+
def arch_from_dict(d):
@@ -318,6 +320,7 @@ def arch_from_dict(d):
return arch
+#TODO: Haven't changed name here but all_platforms should now pull os class list
@memoized
def all_platforms(operating_system=False):
modules = []