From c2596fd09dd5a411d3697a269504d7a12b7bf4db Mon Sep 17 00:00:00 2001 From: Fred Boniface Date: Tue, 12 Nov 2024 11:53:44 +0000 Subject: [PATCH] Fix PIS file formatting --- src/pis_file.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pis_file.py b/src/pis_file.py index f99fe39..63d98a1 100644 --- a/src/pis_file.py +++ b/src/pis_file.py @@ -5,7 +5,8 @@ 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 -- code: {train.get('diagram_pis_code', 'N/A')} +pis: + - code: {train.get('diagram_pis_code', 'N/A')} # diagramDate: {train.get('diagram_date', 'N/A')} # diagramHeadcode: {train.get('train_headcode', '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', []): 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')}