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