Changed name to appropriate camelcase

This commit is contained in:
Mario Melara 2016-02-24 15:31:21 -08:00
parent 9e844d974c
commit 2de81cfc62
3 changed files with 20 additions and 32 deletions

View file

@ -1,7 +1,7 @@
import spack
from spack.architecture import OperatingSystem
class ComputeNodeLinux(OperatingSystem):
class Cnl(OperatingSystem):
""" Compute Node Linux (CNL) is the operating system used for the Cray XC
series super computers. It is a very stripped down version of GNU/Linux.
Any compilers found through this operating system will be used with
@ -11,7 +11,7 @@ class ComputeNodeLinux(OperatingSystem):
def __init__(self):
name = 'CNL'
version = '10'
super(ComputeNodeLinux, self).__init__(name, version, "MODULES")
super(Cnl, self).__init__(name, version, "MODULES")
def compiler_strategy(self):
return self.compiler_strategy

View file

@ -1,6 +1,6 @@
import platform as py_platform
import spack
from spack.architecture import Platform, OperatingSystem
from spack.architecture import OperatingSystem
class LinuxDistro(OperatingSystem):
""" This class will represent the autodetected operating system
@ -10,13 +10,9 @@ class LinuxDistro(OperatingSystem):
platform.dist()
"""
def __init__(self):
def detect_operating_system():
name = py_platform.dist()[0]
version = py_platform.dist()[1]
return name, version
name = py_platform.dist()[0]
version = py_platform.dist()[1]
name, version = detect_operating_system()
super(LinuxDistro, self).__init__(name, version, "PATH")
def compiler_strategy(self):

View file

@ -3,38 +3,30 @@
will be represented using the major version operating system name, i.e
el capitan, yosemite...etc.
"""
import spack
import os
import platform as py_platform
from spack.architecture import Platform, OperatingSystem
import spack
from spack.architecture import OperatingSystem
class MacOSX(OperatingSystem):
class MacOsx(OperatingSystem):
def __init__(self):
""" Autodetects the mac version from a dictionary. Goes back as
far as 10.6 snowleopard. If the user has an older mac then
the version will just be a generic mac_os.
"""
def get_mac_release():
mac_releases = {'10.6': "snowleopard",
"10.7": "lion",
"10.8": "mountainlion",
"10.9": "mavericks",
"10.10": "yosemite",
"10.11": "elcapitan"}
mac_releases = {'10.6': "snowleopard",
"10.7": "lion",
"10.8": "mountainlion",
"10.9": "mavericks",
"10.10": "yosemite",
"10.11": "elcapitan"}
mac_ver = py_platform.mac_ver()[0][:-2]
try:
name = mac_releases[mac_ver]
return name, mac_ver
except KeyError:
name = "mac_os"
return name, mac_ver
mac_ver = py_platform.mac_ver()[0][:-2]
try:
name = mac_releases[mac_ver]
except KeyError:
name = "mac_os"
name, version = get_mac_release()
super(MacOSX, self).__init__(name, version, "PATH")
super(MacOsx, self).__init__(name, mac_ver, "PATH")
def compiler_strategy(self):
return self.compiler_strategy