File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -179,11 +179,21 @@ def _parse_sim(text):
179
179
# record_4 = regexes['sim']['record_4'].finditer(text)
180
180
# record_5 = regexes['sim']['record_5'].search(text).groupdict()
181
181
182
- time_mode = record_2 ['time_mode' ]
183
- if time_mode != 'U' :
184
- raise NotImplementedError ("Support for times other than U not yet implemented. Found time mode " + time_mode )
185
182
flight_leg_records = list (map (lambda x : x .groupdict (), record_3 ))
186
183
flight_leg_records = [_strip_dict_values (x ) for x in flight_leg_records ]
184
+
185
+ if record_2 ["time_mode" ] == "U" :
186
+ [x .update ({"scheduled_time_of_aircraft_arrival" : x ["scheduled_time_of_aircraft_arrival" ] + "+0000" }) for x in flight_leg_records ]
187
+ [x .update ({"scheduled_time_of_passenger_arrival" : x ["scheduled_time_of_passenger_arrival" ] + "+0000" }) for x in flight_leg_records ]
188
+ [x .update ({"scheduled_time_of_aircraft_departure" : x ["scheduled_time_of_aircraft_departure" ] + "+0000" }) for x in flight_leg_records ]
189
+ [x .update ({"scheduled_time_of_passenger_departure" : x ["scheduled_time_of_passenger_departure" ] + "+0000" }) for x in flight_leg_records ]
190
+
191
+ elif record_2 ["time_mode" ] == "L" :
192
+ [x .update ({"scheduled_time_of_aircraft_arrival" : x ["scheduled_time_of_aircraft_arrival" ] + x ["utc_local_time_variation_arrival" ]}) for x in flight_leg_records ]
193
+ [x .update ({"scheduled_time_of_passenger_arrival" : x ["scheduled_time_of_passenger_arrival" ] + x ["utc_local_time_variation_arrival" ]}) for x in flight_leg_records ]
194
+ [x .update ({"scheduled_time_of_aircraft_departure" : x ["scheduled_time_of_aircraft_departure" ] + x ["utc_local_time_variation_departure" ]}) for x in flight_leg_records ]
195
+ [x .update ({"scheduled_time_of_passenger_departure" : x ["scheduled_time_of_passenger_departure" ] + x ["utc_local_time_variation_departure" ]}) for x in flight_leg_records ]
196
+
187
197
# segment_data_records = list(map(lambda x: x.groupdict(), record_4))
188
198
189
199
return flight_leg_records
You can’t perform that action at this time.
0 commit comments