regex match

This commit is contained in:
Martin Diehl 2016-08-01 17:01:13 +02:00
parent 48a9aea9ff
commit 0219a5f0e3
1 changed files with 1 additions and 1 deletions

View File

@ -22,7 +22,7 @@ class Environment():
for line in configFile: for line in configFile:
l = re.sub('^set ', '', line).strip() # remove "set" (tcsh) when setting variables l = re.sub('^set ', '', line).strip() # remove "set" (tcsh) when setting variables
if l and not l.startswith('#'): if l and not l.startswith('#'):
items = map(string.strip,l.split('=')) items = re.split(r'\s*=\s*',l)
if len(items) == 2: if len(items) == 2:
self.options[items[0].upper()] = \ self.options[items[0].upper()] = \
re.sub('\$\{*DAMASK_ROOT\}*',self.rootDir(),os.path.expandvars(items[1])) # expand all shell variables and DAMASK_ROOT re.sub('\$\{*DAMASK_ROOT\}*',self.rootDir(),os.path.expandvars(items[1])) # expand all shell variables and DAMASK_ROOT