Do not publish empty stop services
This commit is contained in:
parent
fddda2063e
commit
8e6bb25471
@ -8,10 +8,11 @@ def humanYaml(pis_list):
|
|||||||
if len(pis['services']) == 1:
|
if len(pis['services']) == 1:
|
||||||
crs = []
|
crs = []
|
||||||
try:
|
try:
|
||||||
for stop in pis['services'][0]['stops']:
|
if (len(pis['services'][0]['stops']) > 0) :
|
||||||
crs.append(owlboard_connector.convert_tiploc_to_crs(stop))
|
for stop in pis['services'][0]['stops']:
|
||||||
additional_pis += f' - code: "{pis["pis"]}"\n'
|
crs.append(owlboard_connector.convert_tiploc_to_crs(stop))
|
||||||
additional_pis += f' stops: [{",".join(crs)}]\n'
|
additional_pis += f' - code: "{pis["pis"]}"\n'
|
||||||
|
additional_pis += f' stops: [{",".join(crs)}]\n'
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
print(err)
|
print(err)
|
||||||
elif len(pis['services']) > 1:
|
elif len(pis['services']) > 1:
|
||||||
|
Reference in New Issue
Block a user