kopia lustrzana https://github.com/piku/piku
improvement: allow newlines in ENV files (#69)
rodzic
8a45c1af85
commit
a5efdf89b5
|
@ -1,6 +1,13 @@
|
|||
# variables are global and can be replaced
|
||||
SETTING1=True
|
||||
SETTING2=${SETTING1}/Maybe
|
||||
|
||||
# addr:port
|
||||
PORT=9080
|
||||
BIND_ADDRESS=0.0.0.0
|
||||
|
||||
# the max number the worker will process
|
||||
RANGE=10
|
||||
|
||||
# worker sleep interval between prints
|
||||
INTERVAL=1
|
2
piku.py
2
piku.py
|
@ -307,7 +307,7 @@ def parse_settings(filename, env={}):
|
|||
|
||||
with open(filename, 'r') as settings:
|
||||
for line in settings:
|
||||
if '#' == line[0]: # allow for comments
|
||||
if '#' == line[0] or len(line.strip()) == 0: # ignore comments and newlines
|
||||
continue
|
||||
try:
|
||||
k, v = map(lambda x: x.strip(), line.split("=", 1))
|
||||
|
|
Ładowanie…
Reference in New Issue