| 
									
										
										
										
											2021-07-17 12:07:45 -04:00
										 |  |  | import json | 
					
						
							| 
									
										
										
										
											2021-07-23 20:04:51 +02:00
										 |  |  | import os | 
					
						
							| 
									
										
										
										
											2021-07-17 12:07:45 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-07-23 20:04:51 +02:00
										 |  |  | with open(os.path.join(os.path.dirname(__file__), 'locations.json'), 'r') as file: | 
					
						
							| 
									
										
										
										
											2021-07-17 12:07:45 -04:00
										 |  |  |     location_table = json.loads(file.read()) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | lookup_id_to_name = {} | 
					
						
							|  |  |  | for item in location_table: | 
					
						
							|  |  |  |     lookup_id_to_name[item["id"]] = item["name"] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | lookup_id_to_name[None] = "Neptune Launch" | 
					
						
							|  |  |  | lookup_name_to_id = {name: id for id, name in lookup_id_to_name.items()} |