now aware of empty lines

This commit is contained in:
Franz Roters 2011-12-20 11:04:29 +00:00
parent b0ba5f7ba3
commit 485ed3742c
1 changed files with 3 additions and 2 deletions

View File

@ -65,10 +65,11 @@ pathInfo = {}
DamaskRoot = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),'../')) DamaskRoot = os.path.normpath(os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])),'../'))
try: # check for user-defined pathinfo try: # check for user-defined pathinfo
file = open(os.path.join(DamaskRoot,'lib/pathinfo')) file = open(os.path.join(DamaskRoot,'lib/pathinfo'))
content = file.readlines() content = map(lambda string: string.strip(),file.readlines())
file.close() file.close()
for line in content: for line in content:
pathInfo[line.split()[0].lower()] = os.path.normpath(line.split()[1]) if not (line.startswith('#') or line == ''):
pathInfo[line.split()[0].lower()] = os.path.normpath(line.split()[1])
except: except:
pass pass