kopia lustrzana https://github.com/piku/piku
Do not process empty lines or commented at Procfile
rodzic
6f0468008a
commit
7a3f89cfa5
8
piku.py
8
piku.py
|
@ -246,13 +246,17 @@ def parse_procfile(filename):
|
||||||
workers = {}
|
workers = {}
|
||||||
if not exists(filename):
|
if not exists(filename):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
with open(filename, 'r') as procfile:
|
with open(filename, 'r') as procfile:
|
||||||
for line in procfile:
|
for line_number, line in enumerate(procfile):
|
||||||
|
line = line.strip()
|
||||||
|
if line.startswith("#") or not line:
|
||||||
|
continue
|
||||||
try:
|
try:
|
||||||
kind, command = map(lambda x: x.strip(), line.split(":", 1))
|
kind, command = map(lambda x: x.strip(), line.split(":", 1))
|
||||||
workers[kind] = command
|
workers[kind] = command
|
||||||
except:
|
except:
|
||||||
echo("Warning: unrecognized Procfile entry '{}'".format(line), fg='yellow')
|
echo("Warning: unrecognized Procfile entry '{}' at line {}".format(line, line_number), fg='yellow')
|
||||||
if not len(workers):
|
if not len(workers):
|
||||||
return {}
|
return {}
|
||||||
# WSGI trumps regular web workers
|
# WSGI trumps regular web workers
|
||||||
|
|
Ładowanie…
Reference in New Issue