Fix PIS file formatting
This commit is contained in:
parent
b0cba1cd57
commit
c2596fd09d
@ -5,6 +5,7 @@ def create_new_pis_file(input):
|
||||
file_content = "# File produced by DGP2\n\nFor Review before merging\nXXXX\n\n"
|
||||
for train in input:
|
||||
file_content += f"""\n
|
||||
pis:
|
||||
- code: {train.get('diagram_pis_code', 'N/A')}
|
||||
# diagramDate: {train.get('diagram_date', 'N/A')}
|
||||
# diagramHeadcode: {train.get('train_headcode', 'N/A')}
|
||||
@ -13,7 +14,7 @@ def create_new_pis_file(input):
|
||||
"""
|
||||
for entry in train.get('timetable_entries', []):
|
||||
file_content += f"""
|
||||
stops: {",".join(stop.lower() for stop in entry.get('stops', []))}
|
||||
stops: [{",".join(stop.lower() for stop in entry.get('stops', []))}]
|
||||
# stpIndicator: {entry.get('stpIndicator', 'N/A')}
|
||||
# trainUid: {entry.get('trainUid', 'N/A')}
|
||||
# scheduleStart: {entry.get('scheduleStart', 'N/A')}
|
||||
|
Loading…
Reference in New Issue
Block a user