01234567890123456789012345678901234567890123456789012345678901234567890123456789
15331534153515361537153815391540154115421543154415451546154715481549155015511552 15531554155515561557155815591560156115621563156415651566156715681569157015711572 |
<----SKIPPED LINES---->
Returns:
A tuple:
- updated persistent_nearby_aircraft
- (possibly empty) dictionary of flight attributes of the new flight upon
its first observation.
- the time of the radio observation if present; None if no radio dump
- a dictionary of attributes about the dump itself (i.e.: # of flights;
furthest observed flight, etc.)
- persistent_path, a data structure containing past details of a flight's
location as described in ParseDumpJson
- a text message indicating any errors in querying FlightAware or
populating flight details
- text string of SUCCESS, WARNING, or FAILURE: warning meaning the query
occurred to soon after the last FA request, FAILURE if the request failed
for some other reason, and SUCCESS if it was otherwise successful.
- timestamp indicating exact time at which FlightAware was queried (or
attempted to be queried), if a query was made in this pass
"""
flight_details = {}
error_message = ''
now = time.time()
if SIMULATION:
(dump_json, json_time) = DUMP_JSONS[SIMULATION_COUNTER]
else:
dump_json = ReadFile(DUMP_JSON_FILE, log_exception=True)
# Often there is no flight aware query, so we need to give a default value
flight_aware_timestamp = 0
json_desc_dict = {}
current_nearby_aircraft = {}
if dump_json:
(current_nearby_aircraft, now,
json_desc_dict, persistent_path) = ParseDumpJson(
dump_json, persistent_path)
if not SIMULATION and log_jsons:
PickleObjectToFile((dump_json, now), PICKLE_DUMP_JSON_FILE, True)
newly_nearby_flight_identifiers = UpdateAircraftList(
persistent_nearby_aircraft, current_nearby_aircraft, now)
<----SKIPPED LINES---->
|
01234567890123456789012345678901234567890123456789012345678901234567890123456789
15331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573 |
<----SKIPPED LINES---->
Returns:
A tuple:
- updated persistent_nearby_aircraft
- (possibly empty) dictionary of flight attributes of the new flight upon
its first observation.
- the time of the radio observation if present; None if no radio dump
- a dictionary of attributes about the dump itself (i.e.: # of flights;
furthest observed flight, etc.)
- persistent_path, a data structure containing past details of a flight's
location as described in ParseDumpJson
- a text message indicating any errors in querying FlightAware or
populating flight details
- text string of SUCCESS, WARNING, or FAILURE: warning meaning the query
occurred to soon after the last FA request, FAILURE if the request failed
for some other reason, and SUCCESS if it was otherwise successful.
- timestamp indicating exact time at which FlightAware was queried (or
attempted to be queried), if a query was made in this pass
"""
flight_details = {}
error_message = ''
status = SUCCESS
now = time.time()
if SIMULATION:
(dump_json, json_time) = DUMP_JSONS[SIMULATION_COUNTER]
else:
dump_json = ReadFile(DUMP_JSON_FILE, log_exception=True)
# Often there is no flight aware query, so we need to give a default value
flight_aware_timestamp = 0
json_desc_dict = {}
current_nearby_aircraft = {}
if dump_json:
(current_nearby_aircraft, now,
json_desc_dict, persistent_path) = ParseDumpJson(
dump_json, persistent_path)
if not SIMULATION and log_jsons:
PickleObjectToFile((dump_json, now), PICKLE_DUMP_JSON_FILE, True)
newly_nearby_flight_identifiers = UpdateAircraftList(
persistent_nearby_aircraft, current_nearby_aircraft, now)
<----SKIPPED LINES---->
|