def readConfig(EventPath):
Config = {}
logger.info('\033[31m Parsing ConfigFile \033[0m \n')
try:
for i in os.listdir(EventPath):
if fnmatch.fnmatch(i, '*.config'):
evfile = os.path.join(EventPath,i)
fobj = open(evfile, 'r')
for line in fobj:
if line[0] != '#' and len(line) > 1:
line = str.split(line, '=')
key = (line[0].replace('\'', '')).strip()
value = line[1].replace('\n','').strip()
Config[key] = value
except:
logger.info('\033[31m File Error Exception \033[0m \n')
return Config
评论列表
文章目录