kopia lustrzana https://github.com/piku/piku
Allow for comments in ENV
rodzic
a631d964b9
commit
20e41e984d
2
piku.py
2
piku.py
|
@ -95,6 +95,8 @@ def parse_settings(filename, env={}):
|
||||||
return {}
|
return {}
|
||||||
with open(filename, 'r') as settings:
|
with open(filename, 'r') as settings:
|
||||||
for line in settings:
|
for line in settings:
|
||||||
|
if '#' = line[0]: # allow for comments
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
k, v = map(lambda x: x.strip(), line.split("=", 1))
|
k, v = map(lambda x: x.strip(), line.split("=", 1))
|
||||||
env[k] = expandvars(v, env)
|
env[k] = expandvars(v, env)
|
||||||
|
|
Ładowanie…
Reference in New Issue