now working with tcsh

This commit is contained in:
Martin Diehl 2016-07-14 12:24:55 +02:00
parent 0fbb56a6ef
commit 83e1970f71
2 changed files with 10 additions and 8 deletions

10
CONFIG
View File

@ -1,8 +1,10 @@
MSC_ROOT=/opt/MSC # "set syntax" needed only for tcsh (but works with bash etc)
MARC_VERSION=2015
DAMASK_NUM_THREADS=4 set MSC_ROOT=/opt/MSC
set MARC_VERSION=2015
ABAQUS_VERSION=6.14-5 set DAMASK_NUM_THREADS=4
set ABAQUS_VERSION=6.14-5
#Set DAMASK_BIN if not $DAMASK_ROOT/bin #Set DAMASK_BIN if not $DAMASK_ROOT/bin
#DAMASK_BIN #DAMASK_BIN

View File

@ -1,7 +1,7 @@
# -*- coding: UTF-8 no BOM -*- # -*- coding: UTF-8 no BOM -*-
import os,subprocess,shlex import os,subprocess,shlex,re
class Environment(): class Environment():
__slots__ = [ \ __slots__ = [ \
@ -23,10 +23,10 @@ class Environment():
def get_options(self): def get_options(self):
with open(self.relPath(self.rootDir()+'/CONFIG')) as configFile: with open(self.relPath(self.rootDir()+'/CONFIG')) as configFile:
for line in configFile: for line in configFile:
l = line.strip() l = re.sub('^set ', '', line).strip()
if l and not l.startswith('#'): if l and not l.startswith('#'):
items = l.split('=') + ['',''] items = l.split('=')
if items[1] != '': # nothing specified if len(items) == 2:
self.options[items[0].upper()] = items[1] self.options[items[0].upper()] = items[1]
def isAvailable(self,software,Nneeded =-1): def isAvailable(self,software,Nneeded =-1):