From 0fbb56a6ef013fe62cfc2a779155c677b4bc8cb5 Mon Sep 17 00:00:00 2001 From: Martin Diehl Date: Wed, 13 Jul 2016 22:31:38 +0200 Subject: [PATCH] python env reads from $DAMASK_ROOT/CONFIG --- CONFIG | 8 ++++++++ lib/damask/environment.py | 10 +++------- 2 files changed, 11 insertions(+), 7 deletions(-) create mode 100644 CONFIG diff --git a/CONFIG b/CONFIG new file mode 100644 index 000000000..e3955baca --- /dev/null +++ b/CONFIG @@ -0,0 +1,8 @@ +MSC_ROOT=/opt/MSC +MARC_VERSION=2015 + +DAMASK_NUM_THREADS=4 + +ABAQUS_VERSION=6.14-5 +#Set DAMASK_BIN if not $DAMASK_ROOT/bin +#DAMASK_BIN diff --git a/lib/damask/environment.py b/lib/damask/environment.py index 8ceb093dd..d9c59a22d 100644 --- a/lib/damask/environment.py +++ b/lib/damask/environment.py @@ -21,14 +21,10 @@ class Environment(): return os.path.normpath(os.path.join(os.path.realpath(__file__),'../../../')) def get_options(self): - if os.path.isfile(os.path.join(os.getenv('HOME'),'.damask/damask.conf')): - configFile = os.path.join(os.getenv('HOME'),'.damask/damask.conf') - else: - configFile = '/etc/damask.conf' - with open(self.relPath(configFile)) as file: - for line in file: + with open(self.relPath(self.rootDir()+'/CONFIG')) as configFile: + for line in configFile: l = line.strip() - if not (l.startswith('#') or l == ''): + if l and not l.startswith('#'): items = l.split('=') + ['',''] if items[1] != '': # nothing specified self.options[items[0].upper()] = items[1]