24 lines
691 B
Python
24 lines
691 B
Python
|
|
'''
|
||
|
|
Created on 21.11.2013
|
||
|
|
|
||
|
|
@author: rauchp
|
||
|
|
'''
|
||
|
|
|
||
|
|
def readConf():
|
||
|
|
confFile = open("config\ems.conf", "r")
|
||
|
|
confDic = {}
|
||
|
|
for line in confFile:
|
||
|
|
line = line.strip()
|
||
|
|
if len(line) > 0 and not line[0] == "#":
|
||
|
|
ident = line.split("=")
|
||
|
|
for i in range(len(ident)):
|
||
|
|
ident[i] = ident[i].strip()
|
||
|
|
val = ident[1].split("#") #cut off comments
|
||
|
|
val[0] = val[0].strip()
|
||
|
|
val[0] = True if val[0] == 'True' else val[0]
|
||
|
|
val[0] = False if val[0] == 'False' else val[0]
|
||
|
|
confDic[ident[0]] = val[0]
|
||
|
|
confFile.close()
|
||
|
|
return confDic
|
||
|
|
|
||
|
|
print readConf()
|