2019-12-13 01:19:16 +05:30
|
|
|
import os
|
|
|
|
|
|
|
|
class Environment():
|
|
|
|
__slots__ = [ \
|
|
|
|
'options',
|
|
|
|
]
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
"""Read and provide values of DAMASK configuration."""
|
|
|
|
self.options = {}
|
2020-02-16 14:19:55 +05:30
|
|
|
self.__get_options()
|
2019-12-13 01:19:16 +05:30
|
|
|
|
|
|
|
def relPath(self,relative = '.'):
|
|
|
|
return os.path.join(self.rootDir(),relative)
|
|
|
|
|
|
|
|
def rootDir(self):
|
|
|
|
return os.path.normpath(os.path.join(os.path.realpath(__file__),'../../../'))
|
|
|
|
|
2020-02-16 14:19:55 +05:30
|
|
|
def __get_options(self):
|
2020-01-14 03:56:40 +05:30
|
|
|
for item in ['DAMASK_NUM_THREADS',
|
|
|
|
'MSC_ROOT',
|
|
|
|
'MARC_VERSION',
|
|
|
|
]:
|
|
|
|
self.options[item] = os.environ[item] if item in os.environ else None
|