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:
|
||||
crs = []
|
||||
try:
|
||||
for stop in pis['services'][0]['stops']:
|
||||
crs.append(owlboard_connector.convert_tiploc_to_crs(stop))
|
||||
additional_pis += f' - code: "{pis["pis"]}"\n'
|
||||
additional_pis += f' stops: [{",".join(crs)}]\n'
|
||||
if (len(pis['services'][0]['stops']) > 0) :
|
||||
for stop in pis['services'][0]['stops']:
|
||||
crs.append(owlboard_connector.convert_tiploc_to_crs(stop))
|
||||
additional_pis += f' - code: "{pis["pis"]}"\n'
|
||||
additional_pis += f' stops: [{",".join(crs)}]\n'
|
||||
except Exception as err:
|
||||
print(err)
|
||||
elif len(pis['services']) > 1:
|
||||
|
Reference in New Issue
Block a user